Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1838648
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:30:28+00:00 2026-05-17T06:30:28+00:00

want declarative transactional management example in spring aop…….. Actually Here <aop:config> <aop:advisor advice-ref=addAdvice pointcut=execution(*

  • 0

want declarative transactional management example in spring aop……..

Actually Here

<aop:config>
    <aop:advisor advice-ref="addAdvice" pointcut="execution(* com.DAO.*.*(..))"/>
</aop:config>
<tx:advice id="addAdvice" transaction-manager="transactionManager">
    <tx:attributes>
        <tx:method name="add*" propagation="REQUIRED" rollback-for="" />
    </tx:attributes>
</tx:advice>

So here what i want to write actually rollback-for=”” , is there any method or any else?
and if method then where will it that method put?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T06:30:29+00:00Added an answer on May 17, 2026 at 6:30 am

    in rollback-for you specify the name of the exception. For example if you you want to rollback for your.pkg.NoProductInStockException, you write

    rollback-for="your.pkg.NoProductInStockException"
    

    This will make the transaction be rolled back if it encounters an exception that matches the specified. If an exception is thrown that does not match, it is propagated to the caller of the service or wrapped into a TransactionRolledBackException

    The transaction documentation explains:

    The recommended way to indicate to the Spring Framework’s transaction infrastructure that a transaction’s work is to be rolled back is to throw an Exception from code that is currently executing in the context of a transaction. The Spring Framework’s transaction infrastructure code will catch any unhandled Exception as it bubbles up the call stack, and make a determination whether to mark the transaction for rollback.

    In its default configuration, the Spring Framework’s transaction infrastructure code only marks a transaction for rollback in the case of runtime, unchecked exceptions; that is, when the thrown exception is an instance or subclass of RuntimeException. (Errors will also – by default – result in a rollback). Checked exceptions that are thrown from a transactional method do not result in rollback in the default configuration.

    You can configure exactly which Exception types mark a transaction for rollback, including checked exceptions.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Just wanted your expert opinions on declarative transaction management for Spring. Here is my
I want to pass an int list (List) as a declarative property to a
I want to implement declarative authorization with mongoid. But cannot succeeded. It seems like
I have a grails 1.2 app and I want to use declarative security in
We're using SQLAlchemy declarative base and I have a method that I want isolate
I wonder what imperative vs declarative steps in Rspec is all about. Here is
I have a problem with the Elixir declarative layer; I want to retrieve, for
Here's my code: from sqlalchemy import create_engine, Column, Integer from sqlalchemy.ext.declarative import declarative_base from
I want to use Spring Cache features but I don't know what dependedencies this
I want to initialize a struct element, split in declaration and initialization. This is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.