Patches item #537246, was opened at 2002-03-30 17:17
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376687&aid=537246&group_id=22866

Category: JBossCMP
Group: v2.4 (stable)
Status: Open
Resolution: None
Priority: 5
Submitted By: Michael Rettig (mrettig)
Assigned to: Nobody/Anonymous (nobody)
Summary: No Exception handling for afterBegin()

Initial Comment:
If a runtime exception is thrown from the afterBegin() 
method of the javax.ejb.SessionSynchronization 
interface, the error is simply logged and ignored. The 
exception needs to be rethrown to the parent class, so 
the transaction can be rolled back and then ignore the 
main method.

package org.jboss.ejb.plugins;
...........
public class StatefulSessionInstanceInterceptor
...........
private class InstanceSynchronization implements 
Synchronization
..............
      public void afterBegin() 
      {
         if (notifySession) 
         {
            try 
            {
               afterBegin.invoke(ctx.getInstance(), 
new Object[0]);
            }
            catch (Exception e) 
            {
*************This is the problem********************
               log.error("failed to invoke 
afterBegin", e);
            }
         }
      }

A runtime exception needs to be thrown to the calling 
object so that proper transaction cleanup can occur. 
This exception needs to then be propagated back to the 
client. Also the main session bean method should not 
be called after a runtime exception is thrown. As of 
right now, the session bean method is executed 
regardless. It's vitally important that the original 
transaction is passed back to the calling client. 
Depending on the nature of the runtime exception, the 
client may be able to handle situation.

I can provide a working junit testcase if needed.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=376687&aid=537246&group_id=22866

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to