[jboss-user] [EJB3] - Re: Singleton in clustered JBoss AS 6 Final

Dan Osterrath do-not-reply at jboss.com
Tue Jan 25 10:35:03 EST 2011

Dan Osterrath [http://community.jboss.org/people/DanOsterrath] created the discussion

"Re: Singleton in clustered JBoss AS 6 Final"

To view the discussion, visit: http://community.jboss.org/message/583100#583100

Well, the flag had to be set before executing the action. Unfortunatelly checking and setting the flag can not be atomic over all nodes. So this might lead to a race condition that multiple instances enter the "synchronized" area. (Which in fact is not synchronized.)

if (flag)
   // <--- here the race condition might occur
   flag = true;
   flag = false;

Reply to this message by going to Community

Start a new discussion in EJB3 at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110125/92d83c30/attachment.html 

More information about the jboss-user mailing list