JBoss Community

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

created by Thomas Setiabudi in jBPM - View the full discussion

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

 

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

 

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

Start a new discussion in jBPM at Community