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

Adrian Brock (JIRA) jira-events at jboss.com
Fri Sep 15 08:34:37 EDT 2006


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

Adrian Brock closed JBAS-3091.
------------------------------

    Fix Version/s:     (was: JBossAS-4.0.6.CR1)
       Resolution: Won't Fix

This issue is replaced by the rewrite of the session pool on the linked task.

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