Isn't that the solution to the problem Miguel had?

Oliver

[EMAIL PROTECTED] schrieb:

unico       2004/10/01 08:20:09

Modified: src/stores/org/apache/slide/store/impl/rdbms JDBCStore.java
Log:
fix bug with multiple configured jdbc stores with dbcp turned on: dbcp pool name must be unique
Revision Changes Path
1.23 +8 -7 jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/JDBCStore.java
Index: JDBCStore.java
===================================================================
RCS file: /home/cvs/jakarta-slide/src/stores/org/apache/slide/store/impl/rdbms/JDBCStore.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- JDBCStore.java 28 Jul 2004 09:34:17 -0000 1.22
+++ JDBCStore.java 1 Oct 2004 15:20:09 -0000 1.23
@@ -59,7 +59,6 @@
implements LockStore, NodeStore, RevisionDescriptorsStore, RevisionDescriptorStore, SecurityStore, ContentStore {
public static final String DBCP_URL = "jdbc:apache:commons:dbcp";
- public static final String DBCP_POOL_NAME = "dbcpPool";
public static final String TRANSACTION_NONE = "NONE";
public static final String TRANSACTION_READ_UNCOMMITTED = "READ_UNCOMMITTED";
@@ -135,6 +134,8 @@
protected boolean useDbcpPooling = false;
+ protected String dbcpPoolName = "dbcpPool" + System.identityHashCode(this);
+
protected int maxPooledConnections = -1;
protected int isolationLevel = DEFAUT_ISOLATION_LEVEL;
@@ -282,7 +283,7 @@
false,
isolationLevel);
PoolingDriver driver = new PoolingDriver();
- driver.registerPool(DBCP_POOL_NAME, connectionPool);
+ driver.registerPool(dbcpPoolName, connectionPool);
// already done when loding PoolingDriver class // DriverManager.registerDriver(driver);
} else {
@@ -307,7 +308,7 @@
Connection connection;
if (useDbcpPooling) {
try {
- connection = DriverManager.getConnection(DBCP_URL + ":" + DBCP_POOL_NAME);
+ connection = DriverManager.getConnection(DBCP_URL + ":" + dbcpPoolName);
} catch (SQLException e) {
getLogger().log("Could not create connection. Reason: " + e, LOG_CHANNEL, Logger.EMERGENCY);
throw e;


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to