OpenEJB
  1. OpenEJB
  2. OPENEJB-998

stateful bean managed transaction are not handled correctly

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.0
    • Fix Version/s: 3.0.1
    • Component/s: container system
    • Labels:
      None
    • Environment:
      open ejb 3.0 in Geronimo 2.1.4 env.

      Description

      There are two probs with steteful bean managed transaction in openejb 3.0 -

      1. The beforeInvoke method in StatefulBeanManagedTxPolicy resumes any transaction, including previously committed or rolled back transaction (in this case, transaction status is Status.STATUS_NO_TRANSACTION). This has been okay in G 2.1.3 where txmanager 2.1.1 is used. But in G 2.1.4 (which uses txmanager 2.1.2), we have no longer tolerate this scenario, and will throw an exception. The fix is to check transaction status here before issue the resume transaction call.

      2. The afterInvoke method in StatefulBeanManagedTxPolicy cached the currentTx then resumed the client transaction. Later on, when StatefulContainer called "instanceManager.poolInstance(..)", it would update the beanTransaction again, which would be the client transaction. The fix is to call the resume client transaction a bit later, when the methodType is REMOVE or Default.

      Will attach a proposed fix for openejb 3.0.x stream shortly

        Activity

        Lin Sun created issue -
        Lin Sun made changes -
        Field Original Value New Value
        Attachment OPENEJB-998.patch [ 12399274 ]
        David Blevins made changes -
        Assignee David Blevins [ dblevins ]
        Hide
        David Blevins added a comment -

        Committed!

        $ svn ci
        Sending container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulBeanManagedTxPolicy.java
        Sending container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java
        Transmitting file data ..
        Committed revision 740362.

        $ svn ci
        Adding container/openejb-core/src/main/java/org/apache/openejb/core/transaction/EjbTransactionUtil.java
        Transmitting file data .
        Committed revision 740363.

        Show
        David Blevins added a comment - Committed! $ svn ci Sending container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulBeanManagedTxPolicy.java Sending container/openejb-core/src/main/java/org/apache/openejb/core/stateful/StatefulContainer.java Transmitting file data .. Committed revision 740362. $ svn ci Adding container/openejb-core/src/main/java/org/apache/openejb/core/transaction/EjbTransactionUtil.java Transmitting file data . Committed revision 740363.
        David Blevins made changes -
        Fix Version/s 3.0.x [ 12312806 ]
        Status Open [ 1 ] Closed [ 6 ]
        Fix Version/s 3.0.1 [ 12313633 ]
        Resolution Fixed [ 1 ]

          People

          • Assignee:
            David Blevins
            Reporter:
            Lin Sun
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development