Print Thread
Page 3 of 3 1 2 3
Re: Application crash without exception on LogOff when busy
#6121 03/17/05 05:46 PM
Joined: Jun 2004
Posts: 12
France
Member
Offline
Member
Joined: Jun 2004
Posts: 12
France
Hi Marco,

In a reply you posted on 15 March, 2004 14:42 (Topic: Application crash without exception on LogOff when busy ) :

What did you want to say exactly by "The timer event will always occur in the main thread, it does not matter where you create it."

Does it means a TTimer.timer procedure where I execute a TOraclequery with Session1 in Thread1 can cause a hang in principal thread working itself with its own session?

Greetings
CdeV

Re: Application crash without exception on LogOff when busy
#6122 03/17/05 08:41 PM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
A TTimer.OnTimer event is generated by Windows, and occurs within the main thread of the application (where all windows events occur). If you access a session from this event, you can interfere with other threads accessing the same session. It cannot interfere with other application functions from the main thread that access this session.


Marco Kalter
Allround Automations
Re: Application crash without exception on LogOff when busy
#6123 03/17/05 10:17 PM
Joined: Jun 2004
Posts: 12
France
Member
Offline
Member
Joined: Jun 2004
Posts: 12
France
OK. Thanks Marco.

In fact, I tried to use Timers created with each of my sessions to insure the session is always connected. :p
So, is there a possibility to periodically refresh all sessions (with or without timers). The goal is to prevent each session to be disconnected after the user's profile defined parameter "Idle time" (60 minutes in this case and cannot be changed mad ).

Re: Application crash without exception on LogOff when busy
#6124 03/18/05 07:37 PM
Joined: Aug 1999
Posts: 22,208
Member
Offline
Member
Joined: Aug 1999
Posts: 22,208
If you set TOracleSession.ThreadSafe to True for all sessions, you can still use a Timer to call TOracleSession.CheckConnection(True) for each session. This will be blocked by simultaneous access from the threads, but it will work okay.

The CheckConnection function will keep the session alive by preventing too much idle time, and will (attempt to) reconnect in case of fatal other failures, such as a killed session, a database that was shutdown and restarted, network failures, and so on.


Marco Kalter
Allround Automations
Page 3 of 3 1 2 3

Moderated by  support 

Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.4
(Release build 20200307)
Responsive Width:

PHP: 7.1.33 Page Time: 0.117s Queries: 13 (0.071s) Memory: 2.5272 MB (Peak: 3.0379 MB) Data Comp: Off Server Time: 2024-05-05 20:41:02 UTC
Valid HTML 5 and Valid CSS