Atomikos Forum |
|
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. |