[jboss-user] [jBPM] - Re: DroolsSpringJpaManager breaks when Database Server is restarted, how to handle it?

Thomas Setiabudi do-not-reply at jboss.com
Tue Aug 13 03:21:22 EDT 2013


Thomas Setiabudi [https://community.jboss.org/people/thomas.setiabudi] created the discussion

"Re: DroolsSpringJpaManager breaks when Database Server is restarted, how to handle it?"

To view the discussion, visit: https://community.jboss.org/message/832436#832436

--------------------------------------------------------------
Hi Maciejs,

I debug the application, and it turns out when I do something like start process(ksession.startProcess(..) ), inside DroolsSpringJpaManager these two functions will be invoked:
1. getApplicationScopedPersistenceContext 
 https://github.com/droolsjbpm/droolsjbpm-integration/blob/5.5.x/drools-container/drools-spring/src/main/java/org/drools/container/spring/beans/persistence/DroolsSpringJpaManager.java#L64-L92 https://github.com/droolsjbpm/droolsjbpm-integration/blob/5.5.x/drools-container/drools-spring/src/main/java/org/drools/container/spring/beans/persistence/DroolsSpringJpaManager.java#L64-L92

this one will never create new Entity Manager (except for the very first time execution). Which is not safe for Database Restart situation.

2. beginCommandScopedEntityManager
 https://github.com/droolsjbpm/droolsjbpm-integration/blob/5.5.x/drools-container/drools-spring/src/main/java/org/drools/container/spring/beans/persistence/DroolsSpringJpaManager.java#L98-L119 https://github.com/droolsjbpm/droolsjbpm-integration/blob/5.5.x/drools-container/drools-spring/src/main/java/org/drools/container/spring/beans/persistence/DroolsSpringJpaManager.java#L98-L119

while this function will always find that entityManager is closed and then create new Entity Manager which is safe on Database Restart situation.
--------------------------------------------------------------

Reply to this message by going to Community
[https://community.jboss.org/message/832436#832436]

Start a new discussion in jBPM at Community
[https://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/20130813/471169af/attachment.html 


More information about the jboss-user mailing list