Announcement Announcement Module
No announcement yet.
Declarative Transaction Question Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • Declarative Transaction Question

    I have a service object configured using TransactionProxyFactoryBean (with DataSourceTransactionManager) and all the methods are set to PROPAGATION_REQUIRED. Can anyone help me understand this behavior that I'm seeing?

    Actions performed in one method of a Struts action class:
    -Struts action calls ServiceObj.methodA and methodA completes successfully.
    -Struts action then calls ServiceOjb.methodB and methodB throws an exception.

    All database actions performed in methodB are rolled back but the database actions performed in methodA are *not* rolled back. Is this behavior correct? I thought that all actions would be rolled back.


  • #2
    This is correct. If you want to group the two operations in one transaction, create a method in your service object that calls the other two and call this method from your Struts action.

    Transactions are scoped to the service object--not the Struts action.