Create a property in the session objects that shows that a statement is current running in a thread!
This is helpfull in a multi threaded environment to see if a statement is running in an other thread.
When this is the case any statement in the main thread should not run, because in this moment the main app will be frozen.
23
votes

-
Alexander Somov commented
Just use Lock's. Session objects are not thread-safe; you should use external code to control access to them.