Page 1 of 1
Detect Session is in use in multi threaded environment
Posted: Sat 17 Nov 2007 21:11
by jfudickar
Hi,
in a multithreaded environment, is there a way to detect, that on any other thread a sql statement is executed for the current session.
For example session.IsInUse
I want to check the application state against the database any time the application is activated. But when in a detail thread something is running, the main thread waits until the detail thread is finished.
Greetings
Jens
Posted: Mon 19 Nov 2007 08:39
by Plash
There is no way to detect that a statement is executing on a session. If you use one TOraQuery component in your thread, you can check result of the Executing and Fetching methods of TOraQuery.
You also can add a counter variable to your thread, increment this variable before openning a query, and decrement after openning.
Posted: Mon 19 Nov 2007 09:46
by jfudickar
My Idea was to add this as a new feature to the session.
The point is to add the following functions
- BeginSessionUsage
EndSessionUsage
IsInUse
Begin and End increments /decrements a counter, they should be thread-save.
InUse returns true if the counter is greater 0.
The Begin/EndeSessionUsage must be included before/after the call's to the oci call's of each component.
This should be included inside the component. It's the only way to be shure to have it in every time.
Greetings
Jens
Posted: Tue 27 Nov 2007 09:38
by jfudickar
Hi Oleg,
any further comment on this?
Please see it as an feature request.
Greetings
Jens
Posted: Tue 27 Nov 2007 10:23
by Plash
We'll consider possibility to add this feature.
Posted: Fri 01 Feb 2008 09:37
by jfudickar
Any news on this??
Posted: Thu 07 Feb 2008 13:22
by Plash
There is a lot of work required to implement this feature. Currently we have some more priority tasks. We'll consider possibility to add this feature in one of the future ODAC versions.
Posted: Thu 07 Feb 2008 14:23
by jfudickar
I agree and i understand.
That's realy sad for multi threaded environments.
Does future odac version meant release 7
Greetings
Jens
Posted: Fri 08 Feb 2008 09:43
by Plash
It is possible that we'll add this feature in ODAC 7.