Quantcast
Channel: SCN : Discussion List - PowerBuilder Developer Center
Viewing all articles
Browse latest Browse all 2881

How to auto reconnect to database after network disconnect?

$
0
0

Hey guys I am fairly new to Powerbuilder, I am trying to add database reconnect functionality to a application, but the application always fatal crashes after returning from the DBError event.

 

 

Flow of Events from Debugger:

 

** Get to breakpoint on Retrieve() statement **

** Manually disconnect network connection **

dw_abc.Retrieve()

uo_transaction - SqlPreview()

uo_transaction - SqlPreview()

** General Network Error messagebox pops up **

uo_transaction - DBError() {

if code = 11 then

  do

    this.test_sql() // function that runs simple SQL to test database connection

 

    if this.SQLCode < 0 then

      sleep(10)

      DISCONNECT using this;

      CONNECT using this;

    end if

  loop while this.SQLCode < 0

end if

return code

}

** Manually reconnect network connection, DBError returns **

uo_transaction - SqlPreview()

** Application fatally crashes - "Sybase Powerbuilder 12.5 has stopped working"**

 

 

Any help or suggestions?

 

 

Resources:

Handling Connection Time Out

SQL Error Handler

How can I tell if I need to do a of_SetTransObject after database disconnect? - Google Groups

Database Connection - Google Groups

DBError - SyBooks Online


Viewing all articles
Browse latest Browse all 2881

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>