commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ma...@apache.org
Subject svn commit: r883393 - in /commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp: ./ datasources/ managed/
Date Mon, 23 Nov 2009 16:18:36 GMT
Author: markt
Date: Mon Nov 23 16:18:35 2009
New Revision: 883393

URL: http://svn.apache.org/viewvc?rev=883393&view=rev
Log:
Fix FindBugs warnings
Some of the inconsistent syncs. These fixes are really only workarounds until 2.0 where we
can fix the API

Modified:
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolableConnectionFactory.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/CPDSConnectionFactory.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/KeyedCPDSConnectionFactory.java
    commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/BasicManagedDataSource.java

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java?rev=883393&r1=883392&r2=883393&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java (original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/BasicDataSource.java Mon Nov
23 16:18:35 2009
@@ -986,7 +986,7 @@
      * pool to be re-initialized. Currently, restart is not triggered, so
      * this property has no effect.
      */
-    private boolean restartNeeded = false;
+    private volatile boolean restartNeeded = false;
     
     /**
      * Returns whether or not a restart is needed. 
@@ -995,7 +995,7 @@
      * 
      * @return true if a restart is needed
      */
-    private synchronized boolean isRestartNeeded() {
+    private boolean isRestartNeeded() {
         return restartNeeded;
     }
 

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolableConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolableConnectionFactory.java?rev=883393&r1=883392&r2=883393&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolableConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/PoolableConnectionFactory.java
Mon Nov 23 16:18:35 2009
@@ -542,7 +542,7 @@
      * Set to <tt>null</tt> to disable {@link java.sql.PreparedStatement} pooling.
      * @param stmtPoolFactory the {@link KeyedObjectPoolFactory} to use to create {@link
KeyedObjectPool}s for pooling {@link java.sql.PreparedStatement}s
      */
-    synchronized public void setStatementPoolFactory(KeyedObjectPoolFactory stmtPoolFactory)
{
+    public void setStatementPoolFactory(KeyedObjectPoolFactory stmtPoolFactory) {
         _stmtPoolFactory = stmtPoolFactory;
     }
 
@@ -724,7 +724,7 @@
     protected volatile int _validationQueryTimeout = -1;
     protected Collection _connectionInitSqls = null;
     protected volatile ObjectPool _pool = null;
-    protected KeyedObjectPoolFactory _stmtPoolFactory = null;
+    protected volatile KeyedObjectPoolFactory _stmtPoolFactory = null;
     protected Boolean _defaultReadOnly = null;
     protected boolean _defaultAutoCommit = true;
     protected int _defaultTransactionIsolation = UNKNOWN_TRANSACTIONISOLATION;

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/CPDSConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/CPDSConnectionFactory.java?rev=883393&r1=883392&r2=883393&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/CPDSConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/CPDSConnectionFactory.java
Mon Nov 23 16:18:35 2009
@@ -51,7 +51,7 @@
     protected ConnectionPoolDataSource _cpds = null;
     protected volatile String _validationQuery = null;
     protected volatile boolean _rollbackAfterValidation = false;
-    protected ObjectPool _pool = null;
+    protected volatile ObjectPool _pool = null;
     protected String _username = null;
     protected String _password = null;
     private Map validatingMap = new HashMap();
@@ -77,7 +77,7 @@
                                  String password) {
         _cpds = cpds;
         _pool = pool;
-        _pool.setFactory(this);
+        pool.setFactory(this);
         _validationQuery = validationQuery;
         _username = username;
         _password = password;

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/KeyedCPDSConnectionFactory.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/KeyedCPDSConnectionFactory.java?rev=883393&r1=883392&r2=883393&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/KeyedCPDSConnectionFactory.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/datasources/KeyedCPDSConnectionFactory.java
Mon Nov 23 16:18:35 2009
@@ -51,7 +51,7 @@
     protected ConnectionPoolDataSource _cpds = null;
     protected volatile String _validationQuery = null;
     protected volatile boolean _rollbackAfterValidation = false;
-    protected KeyedObjectPool _pool = null;
+    protected volatile KeyedObjectPool _pool = null;
     
     /** 
      * Map of PooledConnections for which close events are ignored.
@@ -76,7 +76,7 @@
                                       String validationQuery) {
         _cpds = cpds;
         _pool = pool;
-        _pool.setFactory(this);
+        pool.setFactory(this);
         _validationQuery = validationQuery;
     }
 

Modified: commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/BasicManagedDataSource.java
URL: http://svn.apache.org/viewvc/commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/BasicManagedDataSource.java?rev=883393&r1=883392&r2=883393&view=diff
==============================================================================
--- commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/BasicManagedDataSource.java
(original)
+++ commons/proper/dbcp/trunk/src/java/org/apache/commons/dbcp/managed/BasicManagedDataSource.java
Mon Nov 23 16:18:35 2009
@@ -55,7 +55,7 @@
     /** Transaction Registry */
     private TransactionRegistry transactionRegistry;
     /** Transaction Manager */
-    private TransactionManager transactionManager;
+    private transient TransactionManager transactionManager;
     /** XA datasource class name */
     private String xaDataSource;
     /** XA datasource instance */
@@ -89,7 +89,7 @@
      * Gets the required transaction manager property.
      * @return the transaction manager used to enlist connections
      */
-    public synchronized TransactionManager getTransactionManager() {
+    public TransactionManager getTransactionManager() {
         return transactionManager;
     }
     
@@ -105,7 +105,7 @@
      * Sets the required transaction manager property.
      * @param transactionManager the transaction manager used to enlist connections
      */
-    public synchronized void setTransactionManager(TransactionManager transactionManager)
{
+    public void setTransactionManager(TransactionManager transactionManager) {
         this.transactionManager = transactionManager;
     }
 



Mime
View raw message