 |
SoftTree Technologies
Technical Support Forums
|
|
Author |
Message |
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
Database execute hangs on lack of server |
|
Hi
The following JAL code hung and blocked a queue in our 24x7 windows 3.6.6 environment two days ago when it ran while the db server it connects to was powered down.
DatabaseConnect( "*profilename*" )
Dim rc, number
DatabaseExecute( "Exec *stored proc*", rc )
Surely it should handle that gracefully?
Thanks
Lee
|
|
Tue Dec 29, 2009 4:41 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
Sure. The connection handshake should normally timeout after 60 seconds or so. In case of TCP based connection, socket connection should timeout, and the database driver should catch that and pass back this error to the client application (24x7 in this case) indicating that connection failed. If a different type of connection is used (Local Pipes, Shared Memory, etc…) the behavior of a failed connection is driver specific.
Do you see any sign of a failed connection in debug.log file?
|
|
Wed Dec 30, 2009 12:14 am |
|
 |
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
|
|
it's a tcp based connection very standard to ms sql 2005 via ODBC.
The only thing in the debug file for this job is
29/12/2009 9:53:47.899 2 290 0 DEBUG [THREAD 1596] Invalid CVC Reporting: Process finished with exit code 4294967295
which is when it was killed manually via the web console
The schedule.log file shows
25/12/2009 07:06:25:932 0 290 0 Invalid CVC Reporting Semaphore file(s) *semaphore* found. Submitting job to the queue.
and a bunch of other found semaphores ignored already queued messages.
|
|
Wed Dec 30, 2009 4:53 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
I can only say that normally 24x7 should write a message to debug.log on each database error including failed connections. If there is no message, it means it got stuck before the error reached 24x7.
|
|
Wed Dec 30, 2009 9:21 pm |
|
 |
LeeD
Joined: 17 May 2007 Posts: 311 Country: New Zealand |
|
|
|
So what can I do to prevent this? the code I posted first up is the only code in this job.
|
|
Sun Jan 10, 2010 7:17 pm |
|
 |
SysOp
Site Admin
Joined: 26 Nov 2006 Posts: 7952
|
|
|
|
I suggest to ad PingPort before DatabaseConnect. If that command succeeds, then call DatabaseConnect, if not, fall back and wait for a minute or two before trying again and if the database server is still not responding (server or network could be down) send an alert to notify personnel about the issue.
|
|
Mon Jan 11, 2010 12:17 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
|
|
|