Thanks a lot for your help.

I studied the first piece of code form Patrick Casey with HibSession
and I personaly did it nearly the same way, but I think when you call
attachSession method and the session is taken from user session map
and stored to thread local varibale, so there is copy of the session
for each thread ( this should be thread safe ). But I am not sure
about backward replication to the session object in the user session.
So I think that this would not work as long term session pattern,
because there will be more versions for each thread of session for one
user session. May be I am wrong.

So I use serialization with semaphores to be sure that I still work on
the same session. I use the code in my second message, without
synchronized block ( because this would cause waiting of another
threads connected with other user sessions ).

And to Pablo Ruggia question:

>Sorry about my ignorance on the subject, but will this work in an a
>clustered enviroment ? You are synchornizing just in one server. So two
>servers will be attending at same time the same user.

The application should be deployed only on one server. So, I am not
worring about clustering issues now.

Thanks again for great advice.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to