jcscoobyrs 2005/09/19 18:15:13
Modified: modules/core/src/java/org/openejb/alt/containers/castor_cmp11
CastorCMP11_EntityContainer.java
Log:
Updated for OPENEJB-58. Updated Castor support to 0.9.9M2. Instructions in
the Jira for working around castor-0.9.9.0.jar not being in Maven.
Revision Changes Path
1.12 +13 -16
openejb1/modules/core/src/java/org/openejb/alt/containers/castor_cmp11/CastorCMP11_EntityContainer.java
Index: CastorCMP11_EntityContainer.java
===================================================================
RCS file:
/scm/openejb/openejb1/modules/core/src/java/org/openejb/alt/containers/castor_cmp11/CastorCMP11_EntityContainer.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- CastorCMP11_EntityContainer.java 30 Aug 2005 04:46:33 -0000 1.11
+++ CastorCMP11_EntityContainer.java 19 Sep 2005 22:15:13 -0000 1.12
@@ -66,6 +66,7 @@
import org.exolab.castor.jdo.JDO;
import org.exolab.castor.jdo.OQLQuery;
import org.exolab.castor.jdo.QueryResults;
+import org.exolab.castor.mapping.AccessMode;
import org.exolab.castor.persist.spi.CallbackInterceptor;
import org.exolab.castor.persist.spi.Complex;
import org.exolab.castor.persist.spi.InstanceFactory;
@@ -75,14 +76,13 @@
import org.openejb.OpenEJBException;
import org.openejb.ProxyInfo;
import org.openejb.RpcContainer;
-import org.openejb.loader.SystemInstance;
import org.openejb.core.EnvProps;
import org.openejb.core.Operations;
import org.openejb.core.ThreadContext;
import org.openejb.core.transaction.TransactionContainer;
import org.openejb.core.transaction.TransactionContext;
import org.openejb.core.transaction.TransactionPolicy;
-import org.openejb.util.FileUtils;
+import org.openejb.loader.SystemInstance;
import org.openejb.util.LinkedListStack;
import org.openejb.util.Logger;
import org.openejb.util.SafeProperties;
@@ -288,14 +288,7 @@
* and use the binding directly. It may be possible, however, to
locate it using a Context listing method.
*/
- String transactionManagerJndiName = "java:openejb/" + ( new
java.rmi.dgc.VMID() ).toString().replace( ':', '_' );
-
- /*
- * Because the Tyrex root (used by Castor) is different from the
IntraVM root,
- * we have to bind the TxMgr under env in the IntraVM/comp
- * IntraVM/comp is bound under TyrexRoot/comp so beans can use
java:comp indifferently.
- */
- String transactionManagerJndiNameTyrex = "env/" + ( new
java.rmi.dgc.VMID() ).toString().replace( ':', '_' );
+ String transactionManagerJndiName =
"java:openejb/TransactionManager";
/*
* This container uses two different JDO objects. One whose
transactions are managed by a tx manager
@@ -303,9 +296,6 @@
*/
jdo_ForGlobalTransaction = new JDO();
- // Assign the TransactionManager JNDI name to the dynamically
generated JNDI name
-// jdo_ForGlobalTransaction.setTransactionManager( "java:comp/" +
transactionManagerJndiNameTyrex );
-
jdo_ForGlobalTransaction.setTransactionManager("java:openejb/TransactionManager");
jdo_ForGlobalTransaction.setDatabasePooling( true );
jdo_ForGlobalTransaction.setConfiguration( gTxDb.getAbsolutePath() );
jdo_ForGlobalTransaction.setDatabaseName(EnvProps.GLOBAL_TX_DATABASE);
@@ -359,7 +349,6 @@
// bind the TransactionManager to the dynamically generated JNDI
name
try {
di.getJndiEnc().bind( transactionManagerJndiName,
txReference );
- jdo_ForGlobalTransaction.setTransactionManager(
transactionManagerJndiName );
} catch ( Exception e ) {
logger.error( "Unable to bind TransactionManager to
deployment id = " + di.getDeploymentID() + " using JNDI name = \"" +
transactionManagerJndiName + "\"", e );
throw new org.openejb.SystemException( "Unable to bind
TransactionManager to deployment id = " + di.getDeploymentID() + " using JNDI
name = \"" + transactionManagerJndiName + "\"", e );
@@ -1637,5 +1626,13 @@
}
}
+
+ /*
+ * (non-Javadoc)
+ * @see
org.exolab.castor.persist.spi.CallbackInterceptor#loaded(java.lang.Object,
org.exolab.castor.mapping.AccessMode)
+ */
+ public Class loaded(Object loaded, AccessMode mode) throws Exception {
+ return loaded(loaded, mode.getId());
+ }
}