SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Database execute hangs on lack of server

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Database execute hangs on lack of server
Author Message
LeeD



Joined: 17 May 2007
Posts: 311
Country: New Zealand

Post Database execute hangs on lack of server Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
LeeD



Joined: 17 May 2007
Posts: 311
Country: New Zealand

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
LeeD



Joined: 17 May 2007
Posts: 311
Country: New Zealand

Post Reply with quote
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 View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7952

Post Reply with quote
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 View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
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


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.