Github user tabish121 commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/2448#discussion_r238785616 --- Diff: artemis-jms-client/src/main/java/org/apache/activemq/artemis/jms/client/ActiveMQDestination.java --- @@ -386,14 +386,27 @@ public void setSimpleAddress(SimpleString address) { public void delete() throws JMSException { if (session != null) { + ActiveMQSession sessionToUse = session; + boolean temporary = false; if (session.getCoreSession().isClosed()) { - // Temporary queues will be deleted when the connection is closed.. nothing to be done then! - return; + /** --- End diff -- @jbertram This code is still a bit racey in that the session could become closed right after checking that it isn't and thereby still allow a violation in what the spec says should be possible. It might make more sense to just use the approach of creating a session for this operation each time given this isn't something people are going to be doing a great deal and so doesn't need to be highly performant.
---