[jboss-user] [jBPM] - Drools persistence + Websphere 7 + DB2

Philippe Goncalves do-not-reply at jboss.com
Mon Apr 11 11:00:36 EDT 2011


Philippe Goncalves [http://community.jboss.org/people/filipon] created the discussion

"Drools persistence + Websphere 7 + DB2"

To view the discussion, visit: http://community.jboss.org/message/599266#599266

--------------------------------------------------------------
Hi everyone,

I'm trying to get the persistence of drools flow working in a Websphere 7 + DB2 environment:
- If I run a simple workflow that runs without any wait state, it's ok, I have no errors. SessionInfo is well persisted.
- If I run a workflow with a wait state (First launch well persisted), after completing this wait state and before finishing the workflow, I have an error at line 41 of class JPAWorkItemManager:
((WorkItemImpl) workItem).setId(workItemInfo.getId()); // -> Nullpointer exception because of the the null returned by workItemInfo.getId()
- If I run a workflow running (For example one with a wait state) and if I try to run another workflow in parallel, I have an error at line 141 of class SingleSessionCommandService:
 ((InternalKnowledgeRuntime) ksession).setId( this.sessionInfo.getId() ); // -> Nullpointer exception because of the the null returned by this.sessionInfo.getId()

After invesgating, it seems that I have a problem once the database is locked by a process,  the persists methods from drools don't work anymore for the autogenerated columns of the tables, and then I have problems with tables SessionInfo, WorkItemInfo, etc.

About the way I instantiate the environment variable for the persistence, I make it singleton:
...
    public static Environment getEnvironment() {

        if (environment == null) {
            EntityManagerFactory emf = Persistence.createEntityManagerFactory("testWorkflow");
            environment = KnowledgeBaseFactory.newEnvironment();
            environment.set(EnvironmentName.ENTITY_MANAGER_FACTORY, emf);
        }

        return environment;

    }

...

Here is my persistence.xml:
<persistence xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance http://www.w3.org/2001/XMLSchema-instance"
    xmlns=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence"
    xsi:schemaLocation=" http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence  http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd http://java.sun.com/xml/ns/persistence/persistence_1_0.xsd  http://java.sun.com/xml/ns/persistence/orm http://java.sun.com/xml/ns/persistence/orm  http://java.sun.com/xml/ns/persistence/orm_1_0.xsd http://java.sun.com/xml/ns/persistence/orm_1_0.xsd"
    version="1.0">
<persistence-unit name="testWorkflow" transaction-type="JTA">
        <provider>org.hibernate.ejb.HibernatePersistence</provider>
        <jta-data-source>jdbc/testWorkflow</jta-data-source>
        <class>org.drools.persistence.info.SessionInfo</class>
        <class>org.jbpm.persistence.processinstance.ProcessInstanceInfo</class>
        <class>org.jbpm.persistence.processinstance.ProcessInstanceEventInfo</class>
        <class>org.drools.persistence.info.WorkItemInfo</class>

        <properties>
            <property name="hibernate.dialect" value="org.hibernate.dialect.DB2Dialect" />
            <property name="hibernate.max_fetch_depth" value="5" />
            <property name="hibernate.transaction.manager_lookup_class" value="org.hibernate.transaction.WebSphereExtendedJTATransactionLookup" />
          <property name="hibernate.hbm2ddl.auto" value="update" />
            <property name="show_sql" value="true" />
        </properties>

</persistence-unit>
</persistence>

Thanks for your help!
--------------------------------------------------------------

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

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/20110411/55880933/attachment.html 


More information about the jboss-user mailing list