[jboss-user] [EJB/JBoss] - Locking and synchronization

anil_pathak do-not-reply at jboss.com
Sun Aug 6 12:11:51 EDT 2006


This quistion has been raised several times. Every such issue is answered in relation
with database . How do i implement this simple locking in EJB 2.x 
Stateless Session bean

My EJB is not intended to run in Cluster. Can i voilate the EJB spec by defining static
field and synchronized block in EJB. 


My Hypothetical stateless session bean.
Bean {
    private static Object LOCK = new Object();
    public void abcDef(){
        synchronized(LOCK) {
        ... // Nothing to do with database
        }
    }
}

Thanks for your pointer or suggestion.

Regards,
Anil Pathak


View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3963433#3963433

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3963433



More information about the jboss-user mailing list