Atomikos Forum

ConcurrentModificationException in AtomikosJmsConnectionProxy

Hello,

we have an application where several threads share one JMS Connection object. When it happens that one thread wants to close its JMS Session and another thread concurrently creates a new Session, the call of Session.close() can throw a ConcurrentModificationException.

I took a look at the source and found that in com.atomikos.jms.AtomikosJmsConnectionProxy most accesses to the field "sessions" are protected by "synchronized (sessions)" but the two calls of sessions.add in the method "invoke" are not. I locally changed these two calls from

  sessiona.add ( session );

to

  synchronized (sessions) {
      sessions.add ( session );
  }

and with these changes the problem seems to be gone.
Ralf Menzel Send private email
Thursday, March 11, 2010
 
 
Thanks! Created an issue for this to be fixed soon...
Guy Pardon Send private email
Sunday, March 14, 2010
 
 

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics