I am facing concurrency problem in following scenario.

All our action classes call same stateful session bean .  Each action class 
obtains the reference  from HTTPSession object and calls one and only one 
business method.
To prevent the concurrent access to this instance which occurs when user 
immediately presses two links quickly in succession I am using the following 
code block


execute(...)  //execute methods of Action class
{
....
....

//Obtain the session from  Request.User will always be in session here
session=request.getSession()
Synchronised(session)
{
    //call ejb's  business method.
}

}

However sometimes  more than one thread is able to pass through, And I get 
exception from Appserver. As 2 threads are not allowed for statefull Session 
bean.
Can there be problem in above code. Is it ok to synchronise on session object.





Thanks & Regds
 Ashwani

Ext: 1860







This message contains information that may be privileged or confidential and is 
the property of the Capgemini Group. It is intended only for the person to whom 
it is addressed. If you are not the intended recipient,  you are not authorized 
to read, print, retain, copy, disseminate,  distribute, or use this message or 
any part thereof. If you receive this  message in error, please notify the 
sender immediately and delete all  copies of this message.

Reply via email to