 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
Henrik Ingvarsson
Joined: 15 Aug 2003 Posts: 11
|
|
Job hangs after a few executions |
|
Hello! I have a job that sends traps that contains information from rows i a database. This job has run without problem in several months. Now I'm trying to implement the same job in another application, with the same purpose (sending traps with info from a database). This time there are more rows, and therefore more traps to be sent, and I can't make it run more than maybe three or four times before it hangs. The number of traps to be sent (which equals the number of rows generated by the SQL-clause) can be up to 20 or 25 maybe, but it isn't an enormous amount, is it? If I choose to run it as a detached job, the system tray soon fills up with alarm bell symbols, and the computer has to be restarted. If the job is not run in detached mode, the program simply hangs. Any suggestions on what I should do, or what the problem could be? The general idea behind the code looks like this: ----------------------------------------------------- Dim rows, number Dim exrows, number Dim col1, number Dim col2, number Dim col3, string Dim return, string DatabaseConnect ("db") 1ST_LOOP: DatabaseRetrieve ("SELECT col1, col2, col3 FROM Table1 WHERE col1 = 1 AND col2 = 0)", rows) ForNext( col1, 1, rows, 1, 2ND_LOOP ) DatabaseGet( 1, 1, col1 ) DatabaseGet( 1, 2, col2) DatabaseGet( 1, 3, col3) ConcatEx ( col1, col2, col3 , return) SendTrap( col1, return ) DatabaseDelete( 1 ) Subtract( rows, 1, rows ) 2ND_LOOP: atabaseRetrieve ("SELECT col1, col2, col3 FROM Table2 WHERE col1 = 1 AND col2 = 0)", rows) ForNext( col1, 1, rows, 1, END_LOOPS ) DatabaseGet( 1, 1, col1 ) DatabaseGet( 1, 2, col2) DatabaseGet( 1, 3, col3) ConcatEx ( col1, col2, col3 , return) SendTrap( col1, return ) DatabaseDelete( 1 ) Subtract( rows, 1, rows ) END_LOOPS: DatabaseDisconnect exit ------------------------------------------------------ I have a few more loops like this in the same job, and the "return"-string is a bit longer, but you get the idea... Any help would be appreciated! Thanks /Henrik
|
|
Tue Aug 31, 2004 3:10 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7968
|
|
Re: Job hangs after a few executions |
|
Please make sure SNMP service is running on the second computer and it is configured correctly. PS. The latest version 3.4.21 has a new option for not displaying detached job icons in the system tray. For more infor please see http://www.softtreetech.com/cgi_bin/config.cgi?read=5495 : Hello! : I have a job that sends traps that contains information from rows i a : database. This job has run without problem in several months. Now I'm : trying to implement the same job in another application, with the same : purpose (sending traps with info from a database). This time there are : more rows, and therefore more traps to be sent, and I can't make it run : more than maybe three or four times before it hangs. The number of traps : to be sent (which equals the number of rows generated by the SQL-clause) : can be up to 20 or 25 maybe, but it isn't an enormous amount, is it? If I : choose to run it as a detached job, the system tray soon fills up with : alarm bell symbols, and the computer has to be restarted. If the job is : not run in detached mode, the program simply hangs. Any suggestions on : what I should do, or what the problem could be? : The general idea behind the code looks like this: : ----------------------------------------------------- : Dim rows, number : Dim exrows, number : Dim col1, number : Dim col2, number : Dim col3, string : Dim return, string : DatabaseConnect ("db") : 1ST_LOOP: DatabaseRetrieve ("SELECT col1, col2, col3 FROM Table1 WHERE : col1 = 1 AND col2 = 0)", rows) : ForNext( col1, 1, rows, 1, 2ND_LOOP ) : DatabaseGet( 1, 1, col1 ) : DatabaseGet( 1, 2, col2) : DatabaseGet( 1, 3, col3) : ConcatEx ( col1, col2, col3 , return) : SendTrap( col1, return ) : DatabaseDelete( 1 ) : Subtract( rows, 1, rows ) : 2ND_LOOP: atabaseRetrieve ("SELECT col1, col2, col3 FROM Table2 WHERE : col1 = 1 AND col2 = 0)", rows) : ForNext( col1, 1, rows, 1, END_LOOPS ) : DatabaseGet( 1, 1, col1 ) : DatabaseGet( 1, 2, col2) : DatabaseGet( 1, 3, col3) : ConcatEx ( col1, col2, col3 , return) : SendTrap( col1, return ) : DatabaseDelete( 1 ) : Subtract( rows, 1, rows ) : END_LOOPS: DatabaseDisconnect : exit : ------------------------------------------------------ : I have a few more loops like this in the same job, and the : "return"-string is a bit longer, but you get the idea... : Any help would be appreciated! : Thanks : /Henrik
|
|
Tue Aug 31, 2004 9:07 am |
|
 |
Henrik Ingvarsson
Joined: 15 Aug 2003 Posts: 11
|
|
Re: Job hangs after a few executions |
|
Yes the SNMP-service is running. The job finishes correctly, and the traps are being sent and recieved on the other end. However this only works for two or three executions, before the job hangs. /Henrik : Please make sure SNMP service is running on the second computer and it is : configured correctly. : PS. The latest version 3.4.21 has a new option for not displaying detached : job icons in the system tray. For more infor please see : http://www.softtreetech.com/cgi_bin/config.cgi?read=5495
|
|
Thu Sep 02, 2004 7:02 am |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7968
|
|
Re: Job hangs after a few executions |
|
I suspect the problem is caused by the database connection, not by SNMP traps. You may need to update your database client software. Anyway, try the following workaround Create another job to connect to your database and just to send SNMP traps. Set job schedule to [no schedule] From the main job instead of sending traps run Dim pid, number RunAndWait "24x7 /JOB [second job id]", "", 60, pid This will run the second job with 60 seconds timeout and kill it if it hangs. Replace [second job id] with the actual job number. If you upgrade to 3.4.21 you can also disable the option to show icons in the system tray (see Tools/Options menu, Miscellaneous options) : Yes the SNMP-service is running. The job finishes correctly, and the traps : are being sent and recieved on the other end. However this only works for : two or three executions, before the job hangs. : /Henrik
|
|
Thu Sep 02, 2004 9:31 am |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|