[jboss-user] [jBPM] - Re: Why is Timer event not triggered in J2EE container?
Gary tse
do-not-reply at jboss.com
Mon Aug 8 13:39:17 EDT 2011
Gary tse [http://community.jboss.org/people/garytse] created the discussion
"Re: Why is Timer event not triggered in J2EE container?"
To view the discussion, visit: http://community.jboss.org/message/619951#619951
--------------------------------------------------------------
Thanks for the suggestion, Mare.
The transaction manager is where I'm having problem with.
According to this: http://www.ibm.com/developerworks/websphere/techjournal/0609_alcott/0609_alcott.html http://www.ibm.com/developerworks/websphere/techjournal/0609_alcott/0609_alcott.html
"...to ensure the integrity of transaction context management (and hence the proper management of transactional resources) *WebSphere Application Server does not expose the javax.transaction.TransactionManager interface* to applications or application frameworks deployed into WebSphere Application Server."
As far as I know, both Hibernate and Spring have something of their own to work around this problem, something like :
* *org.hibernate.transaction.WebSphereExtendedJTATransactionLookup*
* *org.springframework.transaction.jta.WebSphereUowTransactionManager*
While I do not know the how Spring and Hibernate work around on TransactionManager, I found a work-around to this problem; and it goes in 2 parts :--
1. WebSphere does not like threads being created in EJB.
The first part of the solution is to fix the threads created directly using J2SE. The class doing that is : *org.drools.time.impl.JDKTimerService. * Using the example and classes from: http://www.ibm.com/developerworks/websphere/techjournal/0606_johnson/0606_johnson.html http://www.ibm.com/developerworks/websphere/techjournal/0606_johnson/0606_johnson.html I was then able to create the thread pool using the WebSphere's WorkerManager. Now, the threads under this are under J2EE context.
2. Re-initialize the "UserTransaction"
When the timer service kicks in, it tries to call the single command service class (forgot actual class at the moment). I perform a JNDI UserTransaction lookup to make it so that the drools transaction manager is new.
I'll try to put a few pieces of code in here later.
Gary
--------------------------------------------------------------
Reply to this message by going to Community
[http://community.jboss.org/message/619951#619951]
Start a new discussion in jBPM at Community
[http://community.jboss.org/choose-container!input.jspa?contentType=1&containerType=14&container=2034]
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110808/12bbf915/attachment.html
More information about the jboss-user
mailing list