svn commit: r536383 - in /ofbiz/trunk/framework/entity: lib/ofbiz-minerva.jar src/org/ofbiz/entity/transaction/MinervaConnectionFactory.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r536383 - in /ofbiz/trunk/framework/entity: lib/ofbiz-minerva.jar src/org/ofbiz/entity/transaction/MinervaConnectionFactory.java

jaz-3
Author: jaz
Date: Tue May  8 17:14:46 2007
New Revision: 536383

URL: http://svn.apache.org/viewvc?view=rev&rev=536383
Log:
updated minerva with a way to get information on the pool of connections

Modified:
    ofbiz/trunk/framework/entity/lib/ofbiz-minerva.jar
    ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/MinervaConnectionFactory.java

Modified: ofbiz/trunk/framework/entity/lib/ofbiz-minerva.jar
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/lib/ofbiz-minerva.jar?view=diff&rev=536383&r1=536382&r2=536383
==============================================================================
Binary files - no diff available.

Modified: ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/MinervaConnectionFactory.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/MinervaConnectionFactory.java?view=diff&rev=536383&r1=536382&r2=536383
==============================================================================
--- ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/MinervaConnectionFactory.java (original)
+++ ofbiz/trunk/framework/entity/src/org/ofbiz/entity/transaction/MinervaConnectionFactory.java Tue May  8 17:14:46 2007
@@ -39,8 +39,8 @@
     public static final String module = MinervaConnectionFactory.class.getName();                
         
     protected static Map dsCache = new HashMap();
-    
-    public static Connection getConnection(String helperName, Element jotmJdbcElement) throws SQLException, GenericEntityException {                              
+
+    public static Connection getConnection(String helperName, Element jotmJdbcElement) throws SQLException, GenericEntityException {
         XAPoolDataSource pds = (XAPoolDataSource) dsCache.get(helperName);        
         if (pds != null) {                                  
             return TransactionFactory.getCursorConnection(helperName, pds.getConnection());
@@ -121,5 +121,21 @@
             XAPoolDataSource pds = (XAPoolDataSource) dsCache.remove(helperName);
             pds.close();  
         }                                                                            
+    }
+
+    public static Set getPooledData(String helperName) throws GenericEntityException {
+        XAPoolDataSource pds = (XAPoolDataSource) dsCache.get(helperName);
+        if (pds == null) {
+            throw new GenericEntityException("No pool found for helper name [" + helperName + "]");
+        }
+        return pds.getPooledObjectRecords(0); // 0 to return all (in use and waiting)
+    }
+
+    public static String getPoolName(String helperName) throws GenericEntityException {
+        XAPoolDataSource pds = (XAPoolDataSource) dsCache.get(helperName);
+        if (pds == null) {
+            throw new GenericEntityException("No pool found for helper name [" + helperName + "]");
+        }
+        return pds.getPoolDataString();
     }
 }