jlaskowski 2004/07/05 11:47:46
Modified: modules/core/src/java/org/openejb/alt/containers/castor_cmp11
CastorCMP11_EntityContainer.java
Log:
Further enhancements to make OpenEJB instances to not interfere with each other when
embedded in separate webapps
Revision Changes Path
1.2 +23 -10
openejb1/modules/core/src/java/org/openejb/alt/containers/castor_cmp11/CastorCMP11_EntityContainer.java
Index: CastorCMP11_EntityContainer.java
===================================================================
RCS file:
/home/projects/openejb/scm/openejb1/modules/core/src/java/org/openejb/alt/containers/castor_cmp11/CastorCMP11_EntityContainer.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- CastorCMP11_EntityContainer.java 26 Mar 2004 21:42:07 -0000 1.1
+++ CastorCMP11_EntityContainer.java 5 Jul 2004 15:47:45 -0000 1.2
@@ -79,6 +79,7 @@
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.util.LinkedListStack;
import org.openejb.util.Logger;
import org.openejb.util.SafeProperties;
@@ -218,6 +219,8 @@
// this map contains the Java language initial values for all all data types
protected HashMap resetMap;
+ private Properties props;
+
//DMB:TODO:1: make logger for life cycle info.
/**
@@ -240,8 +243,7 @@
containerID = id;
deploymentRegistry = registry;
- if ( properties == null ) properties = new Properties();
-
+ this.props = properties;
SafeToolkit toolkit = SafeToolkit.getToolkit( "CastorCMP11_EntityContainer"
);
SafeProperties safeProps = toolkit.getSafeProperties( properties );
@@ -253,14 +255,25 @@
File gTxDb = null;
File lTxDb = null;
try {
- gTxDb = org.openejb.util.FileUtils.getBase().getFile(
Global_TX_Database );
- } catch ( Exception e ) {
- throw new OpenEJBException( "Cannot locate the " +
EnvProps.GLOBAL_TX_DATABASE + " file. " + e.getMessage() );
+ gTxDb = FileUtils.getBase(this.props).getFile( Global_TX_Database );
+ } catch ( Exception ignored ) {
+ try {
+ gTxDb = FileUtils.getHome(this.props).getFile(Global_TX_Database);
+ } catch (Exception e) {
+ throw new OpenEJBException("Cannot locate the " +
EnvProps.GLOBAL_TX_DATABASE + " file. "
+ + e.getMessage());
+ }
}
+
try {
- lTxDb = org.openejb.util.FileUtils.getBase().getFile( Local_TX_Database
);
- } catch ( Exception e ) {
- throw new OpenEJBException( "Cannot locate the " +
EnvProps.LOCAL_TX_DATABASE + " file. " + e.getMessage() );
+ lTxDb = FileUtils.getBase(this.props).getFile( Local_TX_Database );
+ } catch ( Exception ignored ) {
+ try {
+ lTxDb = FileUtils.getHome(this.props).getFile(Local_TX_Database);
+ } catch (Exception e) {
+ throw new OpenEJBException("Cannot locate the " +
EnvProps.LOCAL_TX_DATABASE + " file. "
+ + e.getMessage());
+ }
}
/*