Detect : Session is in Use
Posted: Fri 02 Mar 2007 23:00
I have a multi-threaded environment and want to detect if the session is in use.
Example : I have a background thread which gets some data. The vcl thread has a timer which checks if the connection is valid. THis check is only allowed to run when the background thread is not running.
So i need someting like Session.IsInUse.
If it does not exists, it should be easy to realize
Without having the source, i would say that there should be only some base components which execute any type of sql statements again the session.
And this code should include an threadsafe call "IncIsInUse" and "DecIsInUse" on the connected session.
This should be easy to realize, but would greatly increase my app, without doing it for each sql-call myself.
Greetings and thanks
Jens
Example : I have a background thread which gets some data. The vcl thread has a timer which checks if the connection is valid. THis check is only allowed to run when the background thread is not running.
So i need someting like Session.IsInUse.
If it does not exists, it should be easy to realize
Without having the source, i would say that there should be only some base components which execute any type of sql statements again the session.
And this code should include an threadsafe call "IncIsInUse" and "DecIsInUse" on the connected session.
This should be easy to realize, but would greatly increase my app, without doing it for each sql-call myself.
Greetings and thanks
Jens