This one time, at band camp, Bruce Snyder said:

BS>This one time, at band camp, Arun Sudhakaran said:
BS>
BS>AS>    I'd tested Castor 0.9.4 for the managed connections bug which was reported 
to have been fixed in this release. I used Castor with Jboss 3.0.0. I'd set the 
connection pool size to 5. i tried concurrently accessing the same resource and 
received the follwing exception : 
BS>AS>
BS>AS>javax.resource.ResourceException: No ManagedConnections Available!
BS>AS>        at 
org.jboss.resource.connectionmanager.InternalManagedConnectionPool.getConnection(InternalManagedConnectionPool.java:122)
BS>AS>        at 
org.jboss.resource.connectionmanager.JBossManagedConnectionPool$BasePool.getConnection(JBossManagedConnectionPool.java:312)
BS>AS>        at 
org.jboss.resource.connectionmanager.BaseConnectionManager2.getManagedConnection(BaseConnectionManager2.java:467)
BS>AS>        at 
org.jboss.resource.connectionmanager.LocalTxConnectionManager.getManagedConnection(LocalTxConnectionManager.java:221)
BS>AS>        at 
org.jboss.resource.connectionmanager.BaseConnectionManager2.allocateConnection(BaseConnectionManager2.java:532)
BS>AS>        at 
org.jboss.resource.connectionmanager.BaseConnectionManager2$ConnectionManagerProxy.allocateConnection(BaseConnectionManager2.java:812)
BS>AS>        at 
org.jboss.resource.adapter.jdbc.local.LocalDataSource.getConnection(LocalDataSource.java:102)
BS>AS>        at 
org.exolab.castor.jdo.engine.DatabaseRegistry.createConnection(Unknown Source)
BS>AS>        at 
org.exolab.castor.jdo.engine.TransactionContextImpl.getConnection(Unknown Source)
BS>AS>        at org.exolab.castor.persist.TransactionContext.query(Unknown Source)    
    at org.exolab.castor.jdo.engine.OQLQueryImpl.execute(Unknown Source)
BS>AS>
BS>AS>Since the connection management is being done by close() method in 
org.exolab.castor.jdo.engine.DatabaseImpl.java i'd checked it out and found that the 
else statement is still missing. ie,what would happen when the context is not null and 
is open. So i guess the problem still remains :-(
BS>
BS>Arun, 
BS>
BS>I just refixed bug #1031. That dealt with connections not being returned
BS>to the pool when container managed transactions roll back. I remember this
BS>issue that you speak of, but I am unable to find anything in Bugzilla
BS>(http://bugzilla.exolab.org/). Was there a bug filed on this? 


My apologies, Arun. There was actually no bug filed on this problem. I
remember Andrew from Russia contacted me about this. I actually fixed
the code, but never checked it in because I couldn't test it at the
time. Below is the contextual diff. Can you test this and let me know
the results?

Index: src/main/org/exolab/castor/jdo/engine/DatabaseImpl.java
===================================================================
RCS file: /cvs/castor/castor/src/main/org/exolab/castor/jdo/engine/DatabaseImpl.java,v
retrieving revision 1.73
diff -u -r1.73 DatabaseImpl.java
--- src/main/org/exolab/castor/jdo/engine/DatabaseImpl.java     24 Jan 2002 09:04:02 
-0000      1.73
+++ src/main/org/exolab/castor/jdo/engine/DatabaseImpl.java     23 Oct 2002 10:50:16 
+-0000
@@ -252,7 +252,18 @@
                         _ctx.close();
                     } catch ( Exception except ) {
                     }
-                     throw new PersistenceException( "jdo.dbClosedTxRolledback" );
+                     throw new PersistenceException( Messages.message( 
+"jdo.dbClosedTxRolledback" ) );
+                }
+            }
+            else if ( _ctx != null && _ctx.isOpen() )
+            {
+                try
+                {
+                    _ctx.close();
+                }
+                catch( Exception e )
+                {
+                    throw new PersistenceException( e.getMessage() );
                 }
             }
         } finally {

Bruce
-- 
perl -e 'print unpack("u30","<0G)U8V4\@4VYY9&5R\"F9E<G)E=\$\!F<FEI+F-O;0\`\`");'

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to