[jboss-jira] [JBoss JIRA] Updated: (JBAS-3091) Session recycle bug in org.jboss.jms.asf.StdServerSession

Adrian Brock (JIRA) jira-events at jboss.com
Tue Jul 25 08:47:12 EDT 2006


     [ http://jira.jboss.com/jira/browse/JBAS-3091?page=all ]

Adrian Brock updated JBAS-3091:
-------------------------------

    Fix Version/s: JBossAS-4.0.6.CR1
                       (was: JBossAS-4.0.5.CR1)

> Session recycle bug in org.jboss.jms.asf.StdServerSession
> ---------------------------------------------------------
>
>                 Key: JBAS-3091
>                 URL: http://jira.jboss.com/jira/browse/JBAS-3091
>             Project: JBoss Application Server
>          Issue Type: Feature Request
>      Security Level: Public(Everyone can see) 
>          Components: JMS service
>    Affects Versions: JBossAS-4.0.3 SP1
>            Reporter: Roland R?z
>             Fix For: JBossAS-4.0.6.CR1
>
>
> If a JMS provider throws an unchecked Exception out of Session.run(), the method org.jboss.jms.asf.StdServerSession.run() does recycled the Session without making a rollback on the Session before. If the next message on this recycled Session will be commited the older Message which has been already consumed from the Messaging System before when throwing the Exception will be lost. Because of the Exception this older Message has neither been rollbacked nor committed before.
> To avoid this problem a Session.rollback() needs to be called before recycling it in case of any unchecked Exception. (See code snippet below!)
> Possible Fix:
> public void run()
>    {
>       boolean trace = log.isTraceEnabled();
>       if (trace)
>          log.trace("running...");
>       try
>       {
>          if (xaSession != null)
>             xaSession.run();
>          else
>             session.run();
>       }      
>       // To avoid loosing Messages rollback the Session in case of any Exception from the JMS provider
>       catch (Throwable e) {
>           log.error("Exception occured during the Session.run(). Call Session.rollback() before recycling it.", e);
>           try {
>               if (xaSession != null)
>                   xaSession.rollback();
>                else
>                   session.rollback();
>           }
>           catch (JMSException ex) {
>               log.error("Exception occured when calling Session.rollback()", e);
>           }
>       }
>       finally
>       {
>          if (trace)
>             log.trace("recycling...");
>         
>          recycle();
>          if (trace)
>             log.trace("finished run");
>       }
>    }

-- 
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

        



More information about the jboss-jira mailing list