Using 2 databases in same jboss 3.01 deployment
akeidel Sep 16, 2002 6:26 PMI am setting up jboss 3.01. I want to use two separate databases in the same deployment. To do this, I'm trying to put two xml files for the database service in the server/default/deploy directory.
The problem I'm getting seems to be happenning because jboss is trying to use the same connection pool for the two separate databases. I need to configure it to use separate connection pools. But I don't know what to change in the config xml files to do this.
Below I've pasted (1) the xml config files I'm using and (2) the error message jboss is throwing. Any help is much appreciated!
1. Config files I'm using were going to be attached, but the site wasn't working when I tried that. Anyway, they're almost the same. One is posted below. Only the names "PostgresDS" and "PostgresDB" are changed in the other file, which I didn't bother to paste.
<?xml version="1.0" encoding="UTF-8"?>
<!-- ===================================================================== -->
<!-- -->
<!-- JBoss Server Configuration -->
<!-- -->
<!-- ===================================================================== -->
<!-- ==================================================================== -->
<!-- New ConnectionManager setup for default hsql dbs -->
<!-- Build jmx-api (build/build.sh all) and view for config documentation -->
<!-- ==================================================================== -->
<depends optional-attribute-name="ManagedConnectionFactoryName">
<!--embedded mbean-->
PostgresDS
<config-property name="ConnectionURL" type="java.lang.String">************</config-property>
<config-property name="DriverClass" type="java.lang.String">org.postgresql.Driver</config-property>
<config-property name="UserName" type="java.lang.String">************</config-property>
<config-property name="Password" type="java.lang.String">************</config-property>
<!--Below here are advanced properties -->
<!--hack-->
<depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper
jboss:service=Hypersonic
<depends optional-attribute-name="ManagedConnectionPool">
<!--embedded mbean-->
0
5
5000
15
<!--criteria indicates if Subject (from security domain) or app supplied
parameters (such as from getConnection(user, pw)) are used to distinguish
connections in the pool. Choices are
ByContainerAndApplication (use both),
ByContainer (use Subject),
ByApplication (use app supplied params only),
ByNothing (all connections are equivalent, usually if adapter supports
reauthentication)-->
ByContainer
<depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
<depends optional-attribute-name="JaasSecurityManagerService">jboss.security:service=JaasSecurityManager
java:/TransactionManager
<!--make the rar deploy! hack till better deployment-->
jboss.jca:service=RARDeployer
<!-- Moved to end to test anonymous depends -->
<!--
1476
true
default
false
-->
2. Error from jboss:
23:14:41,123 WARN [LocalTxConnectionManager] reconnecting a connection handle that still has a managedConnection! org.jboss.resource.adapter.jdbc.local.LocalManagedConnection@6c6bb1 org.jboss.resource.adapter.jdbc.local.LocalConnection@12425a
23:14:41,123 ERROR [GlobalTxEntityMap] Store failed on entity:
java.lang.IllegalArgumentException: reconnect(ConnectionRecord cr) called with a non null ManagedConnection that was not killed!
at org.jboss.resource.connectionmanager.BaseConnectionManager2.reconnect(BaseConnectionManager2.java:582)
at org.jboss.resource.connectionmanager.CachedConnectionManager.reconnect(CachedConnectionManager.java:339)
at org.jboss.resource.connectionmanager.CachedConnectionManager.pushMetaAwareObject(CachedConnectionManager.java:137)
at org.jboss.resource.connectionmanager.CachedConnectionInterceptor.storeEntity(CachedConnectionInterceptor.java:385)
at org.jboss.ejb.EntityContainer.storeEntity(EntityContainer.java:705)
at org.jboss.ejb.GlobalTxEntityMap.syncEntities(GlobalTxEntityMap.java:99)
at org.jboss.ejb.EntityContainer.synchronizeEntitiesWithinTransaction(EntityContainer.java:172)
at org.jboss.ejb.EntityContainer.find(EntityContainer.java:656)
at java.lang.reflect.Method.invoke(Native Method)
at org.jboss.ejb.EntityContainer$ContainerInterceptor.invokeHome(EntityContainer.java:1116)