Announcement Announcement Module
Collapse
No announcement yet.
Spring Service Method Commits on an Checked Exception?! Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Spring Service Method Commits on an Checked Exception?!

    I did a little experiment and was surprised to discover that when an exception occurs inside of my Spring “Service method” the transaction is still committed?! I recall reading somewhere that "by default," Spring will only rollback on an unchecked exception!? Please excuse my ignorance if this makes no sense; still learning my way around the highly complex framework

    Anyway, does anyone know of a way to configure Spring so that the rollback occurs on specific (or all) checked exceptions?We are using Spring 3.0.x. Also, I am using the Hibernate Transaction Manager (org.springframework.orm.hibernate3.HibernateTrans actionManager) and my Service method is configured as a PROPAGATION_REQUIRED.

  • #2
    All of that is explained in the transaction chapter of the reference guide. Especially the declarative section.

    Comment


    • #3
      Thanks, for pointing me in the right direction. Got the answer

      Comment

      Working...
      X