Well, a message driven bean with cmt does use xids anyway. If you were to use a jdbc 1/local tx driver the xids for the db don't get out of the jboss vm, so they have essentially no cost: you would however be committing after every message. If you use NoTxConnectionManager jboss will not attempt to enroll your connection in the tx: the connection will be left (or put) in autocommit = true state. I'm not sure this has ever been tested with an XADataSource based driver, but it works fine for jdbc 1 drivers. This should be a good solution for you.
If you don't mind my asking... what does the mdb do if it doesn't write anything anywhere?
I'm reading routing information from the database.
I did get NoTxConnection manager to work... yay!
I was wondering if there was a way to use a managed
connection from an MBean, for example, (look at the
billing-service.xml file attached), I want to use
the 'billing' datasource to log records to the database
using an MBean. Periodically I get exceptions:
Caused by: java.sql.SQLException: Connection handle is not currently associated with a ManagedConnection
... 31 more
Is this a bug or am I configuring things incorrectly?
I'm using Oracle, and it seems to be a "problem".
Can you show some code from your mbean? The only way I know to make this happen is to use a instance variable to hold your connection and use it without synchronization. If you hold the connection in a method local variable or synchronize any method that uses the connection this should not occur.
Yes, I wrote the MBean without synchronization. Thanks for the hint.
I "fixed" it so that connections aren't shared between threads and it works. I sort of gathered from how it was behaving that the JBoss classes weren't thread-safe. I had wondered when I wrote it if that was the intention or not.