Hi

Sorry if this has been discussed previously.
We are using some Message Driven Beans that need direct access to DB (for mostly 
reading).

May be we are doing something wrong... Please help!!!

we acquire the database connection through JNDI
  DataSource ds = ctx.lookup("java:/DefaultDS");
  Connection con = ds.getConnection();

/// use it
  con.close();

the close() method SOMETIMES throws and exception:
java.lang.RuntimeException: Unable to deregister with TransactionManager:
java.lang.IllegalArgumentException: xaRes not enlisted
        at org.jboss.pool.jdbc.xa.XAConnectionFactory$2.closeConnection(Unknown Source)
        at org.jboss.pool.jdbc.xa.XAConnectionFactory$2.connectionClosed(Unknown 
Source)
        at 
org.jboss.pool.jdbc.xa.wrapper.XAConnectionImpl.clientConnectionClosed(Unknown Source)
        at org.jboss.pool.jdbc.xa.wrapper.XAClientConnection.close(Unknown Source)
        at
com.premier.cims.sbl.util.ServiceLocator.releaseReusableConnection(ServiceLocator.java:249)
        at com.premier.cims.sbl.persist.access.GetContract.get(GetContract.java:115)
        at 
com.premier.cims.sbl.persist.PersistBean.getEntityByKey(PersistBean.java:143)
        at java.lang.reflect.Method.invoke(Native Method)
        at
org.jboss.ejb.StatelessSessionContainer$ContainerInterceptor.invoke(StatelessSessionContainer.java:542)
        at
org.jboss.ejb.plugins.StatelessSessionInstanceInterceptor.invoke(StatelessSessionInstanceInterceptor.java:82)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invokeNext(TxInterceptorCMT.java:138)
        at 
org.jboss.ejb.plugins.TxInterceptorCMT.runWithTransactions(TxInterceptorCMT.java:347)
        at org.jboss.ejb.plugins.TxInterceptorCMT.invoke(TxInterceptorCMT.java:100)
        at 
org.jboss.ejb.plugins.SecurityInterceptor.invoke(SecurityInterceptor.java:127)
        at org.jboss.ejb.plugins.LogInterceptor.invoke(LogInterceptor.java:170)
        at 
org.jboss.ejb.StatelessSessionContainer.invoke(StatelessSessionContainer.java:286)
        at
org.jboss.ejb.plugins.local.BaseLocalContainerInvoker.invoke(BaseLocalContainerInvoker.java:297)
        at
org.jboss.ejb.plugins.local.BaseLocalContainerInvoker$StatelessSessionProxy.invoke(BaseLocalContainerInvoker.java:507)
        at $Proxy18.getEntityByKey(Unknown Source)
        at 
com.premier.cims.sbl.mgr.FinderSessionBean.findByKey(FinderSessionBean.java:138)
  etc etc

Could anyone tell us how to acquire a database connection?
Can it be cached? Can the datasource be cached?

many thanks

Benoit.

__________________________________________________
Do You Yahoo!?
Sign up for SBC Yahoo! Dial - First Month Free
http://sbc.yahoo.com


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Caffeinated soap. No kidding.
http://thinkgeek.com/sf
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to