[jboss-jira] [JBoss JIRA] Closed: (JBPM-833) DbPersistenceService.beginTransaction() should check for isTransactionEnabled

Tom Baeyens (JIRA) jira-events at lists.jboss.org
Wed Mar 14 09:00:32 EDT 2007


     [ http://jira.jboss.com/jira/browse/JBPM-833?page=all ]

Tom Baeyens closed JBPM-833.
----------------------------

    Fix Version/s:     (was:  jBPM jPDL 3.2.1)
       Resolution: Rejected

instead, I updated the docs to reflect the current behaviour:

isTransactionEnabled: by default, jBPM will 
        begin a hibernate transaction when the session is fetched the first time and if the 
        jbpmContext is closed, the hibernate transaction will be ended.  The transaction is then
        committed or rolled back depending on wether jbpmContext.setRollbackOnly was called.  The 
        isRollbackOnly property is maintained in the TxService.  To disable transactions and 
        prohibit jBPM from managing transactions with hibernate, configure the isTransactionEnabled 
        property to false as in the example above.  This property only controls the behaviour of 
        the jbpmContext, you can still call the DbPersistenceService.beginTransaction() directly
        with the API, which ignores the isTransactionEnabled setting.  
        For more info about transactions, see
        <xref linkend="hibernatetransactions" />.

> DbPersistenceService.beginTransaction() should check for isTransactionEnabled
> -----------------------------------------------------------------------------
>
>                 Key: JBPM-833
>                 URL: http://jira.jboss.com/jira/browse/JBPM-833
>             Project: JBoss jBPM
>          Issue Type: Bug
>          Components: Core Engine
>    Affects Versions: jBPM jPDL 3.2 beta 2
>         Environment: jbpm-enterprise.ear Jboss AS 4.0.5GA with ejb3 and JMS.
> cvs head version.
>            Reporter: Chris Russell
>         Assigned To: Tom Baeyens
>
> jbm-console web app calls DbPersistenceService.beginTransaction() directly and so it needs to test for isTransactionEnabled.
> In trying to deploy jbpm-enterprise.ear to jboss as 4.0.5ga I cant figure out how to properly configure CMT or JTA so I just set in
> jbpm.cfg.xml 
>  <field name="isCurrentSessionEnabled"><false /></field>
>  <field name="isTransactionEnabled"><false /></field>
> This allowed me to continue trying to successfully run/deploy the ear and jbpm-console. I then started getting an Exception from the JbpmPhaseListener. In looking at code I realized that beginTransaction was not checking the flag. So either make that method private or it needs to check the flag. I changed it to check the flag and this got me on to the next set of issues. (Still dont know how to configure transactions properly)
> code:
>   public void beginTransaction() {
>       //RSC Shouldnt this check for isTransactionEnabled??
>       if (isTransactionEnabled) {
> 	  log.debug("beginning hibernate transaction");
> 	  transaction = session.beginTransaction();
>       } else {
> 	  log.debug("DbPersistenceService.beginTransaction() called but isTransactionEnabled==false");
>       }
>   }  

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

        



More information about the jboss-jira mailing list