[ 
https://issues.apache.org/jira/browse/ARTEMIS-2189?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16709082#comment-16709082
 ] 

ASF GitHub Bot commented on ARTEMIS-2189:
-----------------------------------------

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.


> Allow deleting temporary destination when originating session is closed
> -----------------------------------------------------------------------
>
>                 Key: ARTEMIS-2189
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2189
>             Project: ActiveMQ Artemis
>          Issue Type: Bug
>    Affects Versions: 2.6.3
>            Reporter: Justin Bertram
>            Assignee: Justin Bertram
>            Priority: Major
>
> If a client closes its JMS session (intentionally or not) and then invokes 
> {{javax.jms.TemporaryQueue.delete()}} or 
> {{javax.jms.TemporaryTopic.delete()}} these methods will return without 
> actually deleting the destination (because the underlying session was 
> closed).  The JMS spec states that the lifetime of a temporary destination is 
> tied to the connection rather than the session so even after the session is 
> closed it should still be possible to delete the temporary destination.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to