User: patriot1burke
Date: 01/08/08 15:01:04
Modified: src/main/org/jboss/ejb/plugins AbstractTxInterceptor.java
Log:
fixed minor NPE bug
Revision Changes Path
1.4 +24 -17 jboss/src/main/org/jboss/ejb/plugins/AbstractTxInterceptor.java
Index: AbstractTxInterceptor.java
===================================================================
RCS file:
/cvsroot/jboss/jboss/src/main/org/jboss/ejb/plugins/AbstractTxInterceptor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- AbstractTxInterceptor.java 2001/08/03 17:15:44 1.3
+++ AbstractTxInterceptor.java 2001/08/08 22:01:04 1.4
@@ -25,7 +25,7 @@
* A common superclass for the transaction interceptors.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Ole Husgaard</a>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
abstract class AbstractTxInterceptor
extends AbstractInterceptor
@@ -124,23 +124,30 @@
ex.detail = e;
throw ex;
} catch (RemoteException e) {
- try {
- mi.getTransaction().setRollbackOnly();
- } catch (SystemException ex) {
- Logger.exception(ex);
- } catch (IllegalStateException ex) {
- Logger.exception(ex);
- }
- RemoteException ex;
- if (newTx) {
- if (e instanceof NoSuchObjectException)
+ if (mi.getTransaction() != null)
+ {
+ try {
+ mi.getTransaction().setRollbackOnly();
+ } catch (SystemException ex) {
+ Logger.exception(ex);
+ } catch (IllegalStateException ex) {
+ Logger.exception(ex);
+ }
+ RemoteException ex;
+ if (newTx) {
+ if (e instanceof NoSuchObjectException)
throw e; // Do not wrap this.
- // OSH: Should this be wrapped?
- ex = new ServerException(e.getMessage());
- } else
- ex = new TransactionRolledbackException(e.getMessage());
- ex.detail = e;
- throw ex;
+ // OSH: Should this be wrapped?
+ ex = new ServerException(e.getMessage());
+ } else
+ ex = new TransactionRolledbackException(e.getMessage());
+ ex.detail = e;
+ throw ex;
+ }
+ else
+ {
+ throw e;
+ }
} catch (Error e) {
if (mi.getTransaction() != null) {
try {
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/jboss-development