[
http://jira.jboss.com/jira/browse/JBMESSAGING-660?page=comments#action_12... ]
Ovidiu Feodorov commented on JBMESSAGING-660:
---------------------------------------------
Fixed the deadlock too, by using a "synchronize-copy-loop" pattern
ServerConsumerEndpoint.stop():
if (!toDeliver.isEmpty())
{
// this is to avoid the deadlock described in
http://jira.jboss.com/jira/browse/JBMESSAGING-660
List toDeliverCopy = new ArrayList(toDeliver.size());
synchronized (lock)
{
for (int i = toDeliver.size() - 1; i >= 0; i--)
{
toDeliverCopy.add(toDeliver.get(i));
}
toDeliver.clear();
}
for(Iterator i = toDeliverCopy.iterator(); i.hasNext();)
{
Race Condition Between Session.close and Session.commit or
Session.rollback
---------------------------------------------------------------------------
Key: JBMESSAGING-660
URL:
http://jira.jboss.com/jira/browse/JBMESSAGING-660
Project: JBoss Messaging
Issue Type: Bug
Affects Versions: 1.0.1.GA
Reporter: Clebert Suconic
Assigned To: Ovidiu Feodorov
Fix For: 1.0.1.SP2
Attachments: race.log, trace.txt
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira