Uploaded image for project: 'JBoss Transaction Manager'
  1. JBoss Transaction Manager
  2. JBTM-2888

NestedTopLevel transactions do not rollback state on exception

    Details

    • Type: Bug
    • Status: Open (View Workflow)
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 4.2
    • Fix Version/s: None
    • Component/s: STM
    • Labels:
      None
    • Steps to Reproduce:
      Hide

      See attached file and Description field

      Show
      See attached file and Description field

      Description

      The attached file is a reproducer. Drop it into the STM tests directory and run to see the failure.

      It creates two transactional objects A and B. B is further annotated with @NestedTopLevel. The test:

      • starts a transaction A;
      • calls a write method on A;
      • then calls a write method on B which throws an exception;
      • aborts or commits A (either outcome produces the error)

      Since the container starts a top-level transaction for the call to the method on B I would expect it to abort it if the B method throws an exception. What I find is that it will always call commit.

      This behaviour limits the usefulness of @NestedTopLevel when such methods are called inside an existing transaction since there is no mechanism for rolling back changes.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                marklittle Mark Little
                Reporter:
                mmusgrov Michael Musgrove
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: