Radicore Forum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » RADICORE development » Application Development » Running batch jobs
Running batch jobs [message #5045] Fri, 09 October 2015 21:50 Go to next message
edortizq is currently offline  edortizq
Messages: 82
Registered: August 2008
Location: Ecuador
Member

Dear Tony, I'm trying to run my first batch job, so I created a task using the BATCH pattern, then I try some testing code truncating some tables but nothing happens, when I try to debug my script it never stops on the breakpoints wich are on the generated script.
I'm trying to run this batch task by pressing a navigation button from a multi5 task.
However it's definitely running something because it shows a batch_log_filepicker task after pressing the button and I can open the html output file.

The testing code is:

<?php
//********************************************************** *******************
// run a script in the background
//********************************************************** *******************

$stdout = '../logs/detallemuestras.html';
$csvout = '../logs/detallemuestras.csv';
$pdfout = '../logs/detallemuestras.pdf';

ini_set('include_path', '.');
require 'std.batch.inc';

batchInit(__FILE__);


$conn1millaQry = mysqli_connect('localhost', 'remoto', 'inp1milla', 'unamillaqry');
if (!$conn1millaQry) {
die('No se puede conectar a DB UNAMILLAQRY: ' . mysql_error());
}
echo 'Conexion Exitosa a UNAMILLAQRY'.'<br>';

mysqli_query($conn1millaQry,'TRUNCATE TABLE artespesca');
mysqli_query($conn1millaQry,'TRUNCATE TABLE componentes');
mysqli_query($conn1millaQry,'TRUNCATE TABLE detallemuestras');

mysqli_close($conn1millaQry);

batchEnd();

?>

The html output file (detallemuestras.html) only have this:

user_id : MGR
role_id : GLOBAL

What I'm doing wrong?
Thanks for advance!!

Best regards,
Edgar
Re: Running batch jobs [message #5052 is a reply to message #5045] Sat, 10 October 2015 05:17 Go to previous messageGo to next message
AJM is currently offline  AJM
Messages: 2347
Registered: April 2006
Location: Surrey, UK
Senior Member
You cannot start a batch job from a navigation button and expect it to appear in your debugger. You need to open the script in your IDE and start the debugging session from there. You can then step through the script line by line, or until it hits a breakpoint.

BTW, have you set up the correct options in your batch.ini file?


Re: Running batch jobs [message #5071 is a reply to message #5052] Wed, 14 October 2015 02:13 Go to previous message
edortizq is currently offline  edortizq
Messages: 82
Registered: August 2008
Location: Ecuador
Member

Thank you for your answer. Yes I figured out what you say and all is working now.
Previous Topic: ERROR: 22P02: invalid input syntax for integer
Next Topic: JAVASCRIPT CODE FOR INPUT FIELD
Goto Forum:
  


Current Time: Thu Mar 28 14:00:47 EDT 2024

Total time taken to generate the page: 0.00978 seconds