Results 1 to 3 of 3

Thread: Spring Service Method Commits on an Checked Exception?!

  1. #1
    Join Date
    Apr 2007
    Posts
    16

    Default 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. #2
    Join Date
    Jun 2006
    Location
    The Netherlands
    Posts
    13,625

    Default

    All of that is explained in the transaction chapter of the reference guide. Especially the declarative section.
    Marten Deinum
    Java Consultant / Pragmatist / Open Source Enthousiast / Author


    Pro Spring MVC: With Web Flow
    Conspect

    Have you read the reference guide.
    Use the [ code ] tags, young padawan

  3. #3
    Join Date
    Apr 2007
    Posts
    16

    Default

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

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •