commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pste...@apache.org
Subject svn commit: r498524 - /jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingConnection.java
Date Mon, 22 Jan 2007 04:44:45 GMT
Author: psteitz
Date: Sun Jan 21 20:44:45 2007
New Revision: 498524

URL: http://svn.apache.org/viewvc?view=rev&rev=498524
Log:
Removed synchronization from prepareStatement methods in PoolingConnection.
Synchronization in these methods was causing deadlocks. No resources other
than the prepared statement pool are accessed by these methods, and the pool
methods are synchronized. Fixes DBCP-65 and DBCP-202.
See discussion in DBCP-65. 

Modified:
    jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingConnection.java

Modified: jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingConnection.java
URL: http://svn.apache.org/viewvc/jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingConnection.java?view=diff&rev=498524&r1=498523&r2=498524
==============================================================================
--- jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingConnection.java
(original)
+++ jakarta/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolingConnection.java
Sun Jan 21 20:44:45 2007
@@ -87,7 +87,7 @@
      * Create or obtain a {@link PreparedStatement} from my pool.
      * @return a {@link PoolablePreparedStatement}
      */
-    public synchronized PreparedStatement prepareStatement(String sql) throws SQLException
{
+    public PreparedStatement prepareStatement(String sql) throws SQLException {
         try {
             return(PreparedStatement)(_pstmtPool.borrowObject(createKey(sql)));
         } catch(NoSuchElementException e) {
@@ -103,7 +103,7 @@
      * Create or obtain a {@link PreparedStatement} from my pool.
      * @return a {@link PoolablePreparedStatement}
      */
-    public synchronized PreparedStatement prepareStatement(String sql, int resultSetType,
int resultSetConcurrency) throws SQLException {
+    public PreparedStatement prepareStatement(String sql, int resultSetType, int resultSetConcurrency)
throws SQLException {
         try {
             return(PreparedStatement)(_pstmtPool.borrowObject(createKey(sql,resultSetType,resultSetConcurrency)));
         } catch(NoSuchElementException e) {



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message