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 6362219
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:52:52+00:00 2026-05-24T23:52:52+00:00

I am writing some Advice and I want the Transactions to commit before it

  • 0

I am writing some Advice and I want the Transactions to commit before it gets to the advice. It seems to work for Save and Delete, but when I update, it runs thorough the advice, and then throws the exception.

try {
    retVal = pjp.proceed();
} catch (Exception e) {
    PSPSFaultException fault = new PSPSFaultException(e);
    pmLog.error(ERR_MSG, fault);
    throw fault;
}

As you can see here, I am trying to Wrap the exceptions in our own Runtime exception.

I tried ordering:

<tx:annotation-driven transaction-manager="txManager" order="1"/>

and

@Around( "execution(* blah.blah.PersistenceProvider.*(..))")
@Order(value=2)
public Object persistenceWrapper(ProceedingJoinPoint pjp) throws Throwable {

but this does not seem to make any difference in the stack or functionality.

@Transactional(propagation = Propagation.REQUIRED)
public class PersistenceProviderImpl extends HibernateDaoSupport implements  PersistenceProvider {

@Override
public void update(Object o) {
    this.getHibernateTemplate().update(o);
}

Is there a way to get the update to fire before the advice? The transactions are at the dao level…

  • 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-24T23:52:52+00:00Added an answer on May 24, 2026 at 11:52 pm

    Ok, so you are doing 2 things wrong:

    1. You should have smaler value near your advices and bigger value near
      your transaction manager (higher priority for advices, executed
      first – lower priority for transaction manager, executed later)
    2. Yous should put @Order(1) annotation in front of whole @Aspect class (strange, but it works for me)

    Something like this:

    ...
    <tx:annotation-driven transaction-manager="txManager" order="200"/>  
    ...
    @Order(1)
    @Aspect
    public class MyAspect {
    ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are writing a socket server in c# and need some advice on the
Writing some test scripts in IronPython, I want to verify whether a window is
Say I'm writing some ruby code and I want to use the standard Date
I'm writing some semi-portable code and want to be able to detect when I'm
I'm looking for some advice on writing some thread safe, optimized, elegant code to
We're writing a Netbeans platform app, and we want to add some data as
I'm writing a game in Python and I'm looking for some advice on how
I've recently been writing some basic command-line programs (I want to keep my skills
While writing some C code, I decided to compile it to assembly and read
I was writing some ASP.NET control when I came to the scenario where I

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.