[jboss-user] [EJB/JBoss] - jboss transactions query

vinayh do-not-reply at jboss.com
Wed Apr 16 06:32:37 EDT 2008


Hi,

Using JBoss 4.2 GA, MySQL DB 5.0, MySql Connector/J v5.1.5.

Problem:

I am having a client application (POJO) which inserts data into a database and then invokes an SLSB method by passing the ID of the inserted data. The SLSB tries to retreive the record from the database using JDBC.

The database connection is obtained using the datasource object from the JNDI.

For transaction integrity I am beginning a transaction in the client by getting a UserTransaction object from the JNDI and starting the txn using the begin().

I insert the data into the database and invoke the SLSB method. 

The SLSB method tries to retreive the inserted record but does not find the same as the transaction is yet to be committed.  The SLSB txn-attribute is set to "Mandatory".

I am using the MySql driver com.mysql.jdbc.Driver and not the XA driver as I am having only a single database.

Please let me know if I begin a transaction in the client (different JVM) will the transaction be propogated to the JBoss AS JVM?

If not then please help me in suggesting an alternative solution.

TIA
Vinay

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4144434#4144434

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4144434



More information about the jboss-user mailing list