-
1. Re: JMS+HAIL+XA: Pooled Connections Never reconnects on sing
schrouf Jun 18, 2004 3:24 AM (in response to arisa)Have a look into org.jboss.resource.adapter.jdbc.vendor for some vendor specific ExceptionSorter implementations (currently only Oracle/Sybase). I am not sure, but I guess that a propper ExceptionSorter implementation for your database might do the job. By returning true for a fatal error (based on the database specific error code) the associated connection should be removed from the connection pool by the connection manager (at least this is my expectation ?!?) If you follow this guess, please give a feedback on success/failure.
Regards
Ulf -
2. Re: JMS+HAIL+XA: Pooled Connections Never reconnects on sing
arisa Jun 28, 2004 8:11 PM (in response to arisa)Thanks Ulf for the tip. It wasn't directly applicable as I am using JMS which doesn't have any relations to jdbc and ExceptionSorter. However, it pointed me in the right direction.
I've solved this problem using the following approach:
1. The problem is that the JmsManagedConnection does not register an ExceptionListener for the JMS Connection.
2. I extended the JmsManagedConnection class with my own. My version of setup() sets an exception listener on the JMS Connection.
3. I also extended the JmsManagedConnectionFactory so that it instantiates my extended version of JmsManagedConnection.
4. I then created a new JMS RAR which defines a new Jms Provider which uses my extended JmsManagedConnectionFactory.
5. I then create a new pool of JMS Connections, and use this pool.
It works. There's one bit that's messy: How the exception listener removes the connection from the pool. I couldn't figure this one out. Trying to destroy the ManagedConnection doesn't work, because it will only be flushed from the pool after one user tries to use it (and gets an error that the ManagedConnection has been destroyd).
So, because I was desperate I hacked it so that it calls the flush() method on the ManagedConnectionPool MBean.
If anyone knows how a ManagedConnection can remove itself from a ManagedConnectionPool cleanly without being used anymore, I'd love to hear it.
Thanks to all who considered this problem,
Aris -
3. Re: JMS+HAIL+XA: Pooled Connections Never reconnects on sing
adrian.brock Jun 28, 2004 8:52 PM (in response to arisa)This was all fixed in 3.2.4 for HAJMS
http://cvs.sourceforge.net/viewcvs.py/jboss/jbosscx/src/main/org/jboss/resource/connectionmanager/InternalManagedConnectionPool.java?r1=1.22&r2=1.23 -
4. Re: JMS+HAIL+XA: Pooled Connections Never reconnects on sing
arisa Jun 29, 2004 7:21 PM (in response to arisa)Excellent. I see now why the ManagedConnections do not get flushed from the pool on a ConnectionError.
Thanks all again. -
5. Re: JMS+HAIL+XA: Pooled Connections Never reconnects on sing
wangchen_ca Jun 30, 2004 3:53 PM (in response to arisa)I face similiar problems for failover for HAJMS when singleton node moves.
I tried the link posted by adrian@jboss.org at last-two reply
http://cvs.sourceforge.net/viewcvs.py/jboss/jbosscx/src/main/org/jboss/resource/connectionmanager/InternalManagedConnectionPool.java?r1=1.22&r2=1.23
which does not make sense for me.
Arisa, Can you explain what is your point?
Thanks