Displaying 1 result from an estimated 1 matches for "execute_with_rescue".
2006 Apr 05
0
MS-SQL Server dropping connections
...Most times, the connection appears to get restored fairly quickly
without any intervention on my behalf.
Im several places in the sqlserver adaptor there is code like
@connection.execute(sql)
Im proposing that I wrap this in anthoer method, and use something like
this ( untested so far):
def execute_with_rescue( sql )
reconnect_attempts = 0
retry_count=0
begin
@connection.eexecute(sql)
rescue Win32OLEException => e # or whatever the class is
# send an email so I know its still happening
if /Connection failure/.match( e.to_s )
retry_count+=1...