dain 2004/04/12 00:11:52
Modified: modules/core/src/java/org/openejb/entity
EntityInstanceInterceptor.java
Log:
Added ejbLoad fault handler
Fixed exception handling of ejbLoad
Revision Changes Path
1.4 +13 -2
openejb/modules/core/src/java/org/openejb/entity/EntityInstanceInterceptor.java
Index: EntityInstanceInterceptor.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb/modules/core/src/java/org/openejb/entity/EntityInstanceInterceptor.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- EntityInstanceInterceptor.java 11 Apr 2004 05:55:25 -0000 1.3
+++ EntityInstanceInterceptor.java 12 Apr 2004 04:11:52 -0000 1.4
@@ -47,7 +47,10 @@
*/
package org.openejb.entity;
+import java.rmi.NoSuchObjectException;
import javax.ejb.EntityBean;
+import javax.ejb.NoSuchEntityException;
+import javax.ejb.NoSuchObjectLocalException;
import org.apache.geronimo.core.service.Interceptor;
import org.apache.geronimo.core.service.Invocation;
@@ -98,7 +101,15 @@
}
// associate this instance with the TransactionContext
- transactionContext.associate(context);
+ try {
+ transactionContext.associate(context);
+ } catch (NoSuchEntityException e) {
+ if (ejbInvocation.getType().isLocal()) {
+ throw new NoSuchObjectLocalException().initCause(e);
+ } else {
+ throw new NoSuchObjectException(e.getMessage());
+ }
+ }
}
ejbInvocation.setEJBInstanceContext(context);