tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r526409 - /incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java
Date Sat, 07 Apr 2007 08:39:16 GMT
Author: dain
Date: Sat Apr  7 01:39:15 2007
New Revision: 526409

URL: http://svn.apache.org/viewvc?view=rev&rev=526409
Log:
Handle NoSuchObjectException as application exception
Cancel timers in ejRemove method

Modified:
    incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java

Modified: incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java
URL: http://svn.apache.org/viewvc/incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java?view=diff&rev=526409&r1=526408&r2=526409
==============================================================================
--- incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java
(original)
+++ incubator/openejb/trunk/openejb3/container/openejb-core/src/main/java/org/apache/openejb/core/cmp/CmpContainer.java
Sat Apr  7 01:39:15 2007
@@ -403,6 +403,7 @@
                 entityBean.getClass().getMethod("OpenEJB_deleted").invoke(entityBean);
             } catch (Exception ignored) {
             }
+            cancelTimers(callContext);
             ThreadContext.exit(oldCallContext);
         }
     }
@@ -479,6 +480,8 @@
                 /* Application Exception ***********************/
                 txPolicy.handleApplicationException(ite.getTargetException(), txContext);
             }
+        } catch (NoSuchObjectException e) {
+            txPolicy.handleApplicationException(e, txContext);
         } catch (Throwable e) {
             /* System Exception ****************************/
             txPolicy.handleSystemException(e, bean, txContext);
@@ -803,11 +806,12 @@
             CmpEngine cmpEngine = getCmpEngine(deploymentInfo);
             EntityBean entityBean = (EntityBean) cmpEngine.loadBean(callContext, callContext.getPrimaryKey());
             if (entityBean == null) {
-                throw new ObjectNotFoundException(callContext.getDeploymentInfo().getDeploymentID()
+ " " + callContext.getPrimaryKey());
+                throw new NoSuchObjectException(callContext.getDeploymentInfo().getDeploymentID()
+ " " + callContext.getPrimaryKey());
             }
             ejbRemove(entityBean);
             cmpEngine.removeBean(callContext);
-            cancelTimers(callContext);
+        } catch (NoSuchObjectException e) {
+            txPolicy.handleApplicationException(e, txContext);
         } catch (Throwable e) {// handle reflection exception
             txPolicy.handleSystemException(e, null, txContext);
         } finally {



Mime
View raw message