[jboss-jira] [JBoss JIRA] Created: (JBRULES-2332) Drools JPA- Spring Transactions

Pradeep Thomas (JIRA) jira-events at lists.jboss.org
Thu Nov 12 05:35:05 EST 2009


Drools JPA- Spring Transactions
-------------------------------

                 Key: JBRULES-2332
                 URL: https://jira.jboss.org/jira/browse/JBRULES-2332
             Project: Drools
          Issue Type: Bug
      Security Level: Public (Everyone can see)
    Affects Versions: 5.0.1.FINAL
         Environment: Java    (1.6)
Spring framework (2.5.6)
Hibernate  (3.3.2.GA)
Drools   (5.0.1) Using Expert and Flow parts.
Oracle  (11g)
            Reporter: Pradeep Thomas
            Assignee: Mark Proctor


What we do

We have a domain model. It is made up of a number of objects annotated with JPA annotations (for persistence) with Hibernate as the ORM provider. 
The drools JPA persistence module is also made of java classes annotated for persistence.

We're trying to create a stateful session and start a process. Process stops in a waiting state at some point. Then we want to persist the session together with the process state. Application needs to be able to load the session back into memory and continue with the process execution (by sending notify events).

Issues

First issue
The first issue we faced was that the drools persistence module does not work out of box for Oracle.
Cause: Table/column names too long, 
Fix: This was sorted by overrides to the annotations in the drools-jpa source code.

Current issue
The issues that we are currently facing are related to transactions/JPA entity manager and persisting of Session/Process/Workitem etc.
The expected transactional/persistence behaviour is

       ------- Begin Transaction (triggered by Spring's transactional annotation that also creates the entity manager)
   
  1) Persist/Read domain entities from datasource
  2) Persist/Read drools entities from same datasource

       -------End Transaction (commit/rollback releases the entity manager)

The expected behaviour is without the use of a distributed transaction manager (because we have a single datasource and no distributed transactions)

It seems like the persistence module out of the box in drools-jpa relies on a Distributed transaction manager (DTM) and in the absence of one (configured by us) uses Bitronix (an built-in DTM)
The use of Bitronix further complicates matters as its not related to the transaction/entity manager created by Spring and visibility of domain entities/drools entities have of each other.

The way we would like to use drools persistence is:

a) Entities (drools/domain) to be managed by the same entity manager (persisted/read) for both Domain model entities and Drools JPA entities.
b) Participate in the same (RESOURCE_LOCAL) transaction (committed/rolled back)
c) Eliminate the need for a DTM if there is a single datasource

Question : is there anything we're doing is incorrect or is the described behaviour not available in the current version?

Any advice would be appreciated.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: https://jira.jboss.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list