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.