[jboss-user] [JCA/JBoss] - Stateless EJB calling WorkManager directly - legal?

gsniderJBoss do-not-reply at jboss.com
Fri Mar 7 14:59:42 EST 2008

If a stateless EJB gets a JBossWorkManager (see code below) without going through an RA, should everything still work?

The problem I'm seeing is:
1) A CMT transaction TX1 is created in the EJB via hibernate call.
2) the ejb schedules work in the WorkManager [workManager.scheduleWork(myWork, WorkManager.INDEFINITE, new ExecutionContext(), myListener); ]
3) A new transaction is created TX2 by the WorkManager
4) TX2 cannot 'see' any of the changes from TX1  either from inserts, updates and even after calling flush on the Hibernate session

How can I coordinate these transactions?  Do I need an RA?

Config:  4.2.2.GA on MySQL 5.x
XA-DataSource using MySQL xa driver

EJB getting a JBossWorkManager:
MBeanServerConnection mconn = (MBeanServerConnection) ctx.lookup("jmx/invoker/RMIAdaptor");
  | ObjectName objectName = new ObjectName("jboss.jca:service=WorkManager");
  | JBossWorkManagerMBean jwm = (JBossWorkManagerMBean) MBeanServerInvocationHandler.newProxyInstance(blah,  objectName,		JBossWorkManagerMBean.class,false);

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

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

More information about the jboss-user mailing list