NetTalk Central
NetTalk Web Server => Web Server - Ask For Help => Topic started by: lanmicro on October 20, 2015, 08:29:32 AM
-
Hi Guys,
I have a webserver that is hanging several times a day when it loses its connection to the Scalable database.
It appears to occur when a p_web.Open is issued at the beginning of a procedure. I have placed a prop:disconnect before the p_web.Opens, but the hangs are still occurring.
Is there some way to capture the fact of the lost connection before the p_web.Open and issue a prop:disconnect and reopen all of my files?
-
I'm not the SQL guy here Greg, but maybe someone else can jump in with a suggestion?
-
Hi Bruce, I placed code like the following in the OpenFiles routine:
loop 5 times
ds_OutputDebugString( 'Opening Files' )
ds_OutputDebugString( clip( GLO:UCABATCH )&' '&GLO:FILESPEC:Batch )
State{ PROP:Disconnect }
accdef{ prop:Disconnect }
batch{ PROP:Disconnect }
open( Company, 42h )
if errorcode()
ds_OutputDebugString( 'Company error '& errorcode() )
cycle
end!if
open( Activity, 42h )
if errorcode()
ds_OutputDebugString( 'Activity error '& errorcode() )
cycle
end!if
open( Flags, 42h )
if errorcode()
ds_OutputDebugString( 'Flags error '& errorcode() )
cycle
end!if
open( Client2, 42h )
if errorcode()
ds_OutputDebugString( 'Client2 error '& errorcode() )
cycle
end!if
open( SITE, 42h )
if errorcode()
ds_OutputDebugString( 'Site error '& errorcode() )
cycle
end!if
if errorcode()
ds_OutputDebugString( 'Batch error '& errorcode() )
cycle
end!if
if errorcode() then cycle.
break
end!loop
This appears to have resolved the problem with the server disconnecting.
-
Hi Greg,
Instead of putting this in OpenFiles, which is very far down the tree (so to speak), perhaps it would be better to add this to the FileManager object itself? that's the "root" of all the opens in the program, and so would be best equipped to deal with a problem which happens during Open.
Is it worth experimenting with this?
cheers
Bruce
-
Hi Bruce,
Not sure if it is worth pursuing. Sometimes the error about the connection dropping happens between opening of consecutive files. That's why I have the code inside a loop. So that all files are attempted to be opened at the same time again if an error occurs.