[jboss-user] [JBoss Messaging] - Re: JMS Server Locks Up

clebert.suconic@jboss.com do-not-reply at jboss.com
Wed Feb 14 11:08:50 EST 2007


http://jira.jboss.org/jira/browse/JBMESSAGING-836


I see that ServerConnectionEndpoint::setSTarted is synchronizing sessions 
anonymous wrote : 
  |    private void setStarted(boolean s) throws Throwable
  |    {
  |       synchronized(sessions)
  |       {
  |          for (Iterator i = sessions.values().iterator(); i.hasNext(); )
  |          {
  |             ServerSessionEndpoint sd = (ServerSessionEndpoint)i.next();
  |             sd.setStarted(s);
  |          }
  |          started = s;
  |       }
  |    }   
  | 

While this pattern will also synchronize sessions:

anonymous wrote :         
  |  for(Iterator i = new HashSet(sessions.values()).iterator(); i.hasNext(); )
  | 


So... basically I know how to fix this... but it would be nice to have a testcase replicating this. I'm trying to exercize my imagination now.. any help?

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

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



More information about the jboss-user mailing list