0 Replies Latest reply on Jul 16, 2004 5:25 PM by jbone

    handling non-XA datasources and mdb transactions


      I've been through the FAQs again on handling transactions in an MDB, and wanted to make sure I'm not making some wild assumption. My application is running poorly through JBOSS, but I'm convinced it's my fault and with a little help . . .

      Overview: I have an app which posts a message to a queue in XML. An MDB picks up the message and runs a session bean to parse it. This session bean, in turn, runs another session beans which in turn access/update Entity Beans. Then this final session bean send messages back to the client about what it's done.

      My problem is with transactions - the server is real slow, and some here have suggested that it's because I'm not running the initial session bean in a transaction.

      According to the FAQ, you'll have a problem if you set up CMT MDB (required) with a non-XA datasource (I'm using mysql). So you have to change some things . . .

      I think what I need to do is grab a transaction using JNDI from within the onMessage handler of my MDB, then run the target session bean, then commit the transaction (all within onMessage).

      What I'm fuzzy on is how to set up the deployment descriptors - I'm assuming you set them up with a "Not Supported" attribute, although I guess you could just not put any transaction attributes in at all for those MDBs(?) Also, will using java/ConnectionFactory instead of java/JmsXA make a difference? (I'm under the impression that helps with message delivery itself, but not with what happens onMessage). Also, my session beans should all have the "Required" parameter set on transaction, I'm assuming. Finally, my Entity Beans have a fair amount of database accesses within them (theyre 'mostly' cmp, but have some extra db work to do on updates) -- I know this will have performance ramifications of its own, but could that be affecting the transactional properties?