Collection modified exception in Connection.Close() when using temp 
destinations.
---------------------------------------------------------------------------------

                 Key: AMQNET-378
                 URL: https://issues.apache.org/jira/browse/AMQNET-378
             Project: ActiveMQ .Net
          Issue Type: Bug
    Affects Versions: 1.5.3
            Reporter: Tom
            Assignee: Jim Gomes


Collection Connection.tempDests is modified during enumeration and results in 
an exception and a failure to close connections.

In Connection Close()

{code}
foreach(ActiveMQTempDestination dest in this.tempDests.Values)
{
    dest.Delete();
}{code}


In ActiveMQTempDestination..

        {code}public void Delete()
        {
            if(this.connection != null)
            {
                this.connection.DeleteTemporaryDestination(this);
            }
        }{code}


Connection.DeleteTemporaryDestination..

                {code}public void DeleteTemporaryDestination(IDestination 
destination)
                {
            CheckClosedOrFailed();

            ActiveMQTempDestination temp = destination as 
ActiveMQTempDestination;

            foreach(Session session in this.sessions)
            {
                if(session.IsInUse(temp))
                {
                    throw new NMSException("A consumer is consuming from the 
temporary destination");
                }
            }

            this.tempDests.Remove(destination as ActiveMQTempDestination);
                        this.DeleteDestination(destination);
                }{code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to