Question about disconnect after lost connection

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jdorlon
Posts: 197
Joined: Fri 05 Jan 2007 22:07

Question about disconnect after lost connection

Post by jdorlon » Thu 13 Jan 2022 22:02

Hello,

If a TOraSession has been timed out, but the TOraSession doesn't know it yet because it hasn't run a query in a while, then when the TOraSession is freed, there is a delay because it tries to disconnect first.

Is there a way that I can just free the TOraSession without any attempted interaction with the database?

I don't want to do this all the time - just in rare situations when I want to shut down my application as fast as possible.

Thanks

-John

MaximG
Devart Team
Posts: 1776
Joined: Mon 06 Jul 2015 11:34

Re: Question about disconnect after lost connection

Post by MaximG » Tue 18 Jan 2022 20:49

Could you expand a bit more on the issue? What is the purpose of freeing the TOraSession object in your code? If Oracle server returns an error, you can handle it in the TRY...EXCEPT block. The fastest way to close an application is by using the Halt procedure.

jdorlon
Posts: 197
Joined: Fri 05 Jan 2007 22:07

Re: Question about disconnect after lost connection

Post by jdorlon » Tue 18 Jan 2022 21:45

Hello,

I am freeing the TOraSession because I am done with it. If there is an error, I don't care since, and I know that I can try..except around it. But I don't want to wait for it either. Sometimes there is a delay if the connection has been lost. I would like to know if there is a way that I can free the TOraSession with no further communication to the database.

I know about HALT, but I'd rather avoid it if possible.

Thank you.

MaximG
Devart Team
Posts: 1776
Joined: Mon 06 Jul 2015 11:34

Re: Question about disconnect after lost connection

Post by MaximG » Fri 21 Jan 2022 10:09

The communication between the Oracle server and client requires that packets are sent and received even on connection loss, thus we cannot change the behavior of our product. As a workaround, you may try to close the connection in a separate thread so the main thread of the application is not delayed.

Post Reply