dblevins    2005/08/07 20:02:15

  Modified:    modules/core/src/java/org/openejb/alt/containers/castor_cmp11
                        CastorCmpEntityTxPolicy.java
  Log:

  Set the JDO classloader on every call into the container
  
  Revision  Changes    Path
  1.2       +8 -3      
openejb1/modules/core/src/java/org/openejb/alt/containers/castor_cmp11/CastorCmpEntityTxPolicy.java
  
  Index: CastorCmpEntityTxPolicy.java
  ===================================================================
  RCS file: 
/home/projects/openejb/scm/openejb1/modules/core/src/java/org/openejb/alt/containers/castor_cmp11/CastorCmpEntityTxPolicy.java,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- CastorCmpEntityTxPolicy.java      26 Mar 2004 21:42:10 -0000      1.1
  +++ CastorCmpEntityTxPolicy.java      8 Aug 2005 00:02:15 -0000       1.2
  @@ -9,6 +9,7 @@
   import org.openejb.ApplicationException;
   import org.openejb.core.transaction.TransactionContext;
   import org.openejb.core.transaction.TransactionPolicy;
  +import org.openejb.core.DeploymentInfo;
   
   /**
    * Wraps the TxPolicies for EntityBeans beans with container-managed
  @@ -47,7 +48,12 @@
   
       public void beforeInvoke(EnterpriseBean instance, TransactionContext 
context) throws org.openejb.SystemException, org.openejb.ApplicationException{
           policy.beforeInvoke( instance, context );
  -        
  +
  +        DeploymentInfo deploymentInfo = 
context.callContext.getDeploymentInfo();
  +        ClassLoader classLoader = 
deploymentInfo.getBeanClass().getClassLoader();
  +        cmpContainer.jdo_ForLocalTransaction.setClassLoader(classLoader);
  +        cmpContainer.jdo_ForGlobalTransaction.setClassLoader(classLoader);
  +
           Database db = null;
           try{
               if( context.currentTx == null ) {
  @@ -56,7 +62,6 @@
                   * must be executed on Database object aquired from a JDO 
object that was not
                   * initated with a transaction manager name.
                   */
  -                
                   db = jdo_ForLocalTransaction.getDatabase();
                   
                   /*
  
  
  

Reply via email to