[jBPM] - Re: DroolsSpringJpaManager breaks when Database Server is restarted, how to handle it?
Thomas Setiabudi <[email protected]> Tue, 13 Aug 2013 03:21:22 -0400
| Newsgroups | gmane.comp.java.jboss.user |
|---|---|
| Message-ID | <[email protected]> |
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] _______________________________________________ jboss-user mailing list [email protected] https://lists.jboss.org/mailman/listinfo/jboss-user