db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tfisc...@apache.org
Subject svn commit: r1237854 - /db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/JndiDataSourceFactory.java
Date Mon, 30 Jan 2012 17:57:41 GMT
Author: tfischer
Date: Mon Jan 30 17:57:41 2012
New Revision: 1237854

URL: http://svn.apache.org/viewvc?rev=1237854&view=rev
Log: (empty)

Modified:
    db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/JndiDataSourceFactory.java

Modified: db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/JndiDataSourceFactory.java
URL: http://svn.apache.org/viewvc/db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/JndiDataSourceFactory.java?rev=1237854&r1=1237853&r2=1237854&view=diff
==============================================================================
--- db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/JndiDataSourceFactory.java
(original)
+++ db/torque/torque4/trunk/torque-runtime/src/main/java/org/apache/torque/dsfactory/JndiDataSourceFactory.java
Mon Jan 30 17:57:41 2012
@@ -31,10 +31,8 @@ import javax.naming.NamingException;
 import javax.sql.DataSource;
 
 import org.apache.commons.configuration.Configuration;
-
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-
 import org.apache.torque.TorqueException;
 
 /**
@@ -108,7 +106,10 @@ public class JndiDataSourceFactory
         {
             try
             {
-                ds = ((DataSource) ctx.lookup(path));
+                synchronized (ctx)
+                {
+                    ds = ((DataSource) ctx.lookup(path));
+                }
                 lastLookup = time;
             }
             catch (Exception e)
@@ -245,7 +246,10 @@ public class JndiDataSourceFactory
 
             if (dataSource != null)
             {
-                bindDStoJndi(ctx, path, dataSource);
+                synchronized (ctx)
+                {
+                    bindDStoJndi(ctx, path, dataSource);
+                }
             }
         }
         catch (Exception e)



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


Mime
View raw message