[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - CMP transactions in hibernate and using WorkManager

gsniderJBoss do-not-reply at jboss.com
Tue Mar 4 13:12:30 EST 2008

First, the environment:

One EJB and one database table (SearchSession) managed by Hibernate.
JBoss 4.2.2 GA  and MySQL 5.x on Windows XP Pro

Using CMP, the ejb saves a session in the table and saves the PK id.
Then 3 tasks need to be completed asynchronously so we use the javax.resource.spi.work.WorkManager and Work classes.

The problem:
The spawned Work objects need to 'see' the PK id created by hibernate.  But when calling .get with that PK, there are no records.  So these 3 Work(ers) return with 0 results.  The initial EJB call finishes and THEN the session record is commited!

The question:
How can the WorkManager and Work objects participate in the current transaction?  If they did, they would 'see' that PK.

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

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

More information about the jboss-user mailing list