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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:29:28+00:00 2026-06-04T06:29:28+00:00

While doing loadtesting on our application I noticed that if you use @Transactional and

  • 0

While doing loadtesting on our application I noticed that if you use @Transactional and @Cacheable annotions that hibernate always creates a database transaction. Is there an easy way to prevent this?
A more eleberate way to solve this within spring is to have following class/interfaces

  • Servicelayer-interface
  • Cacheable annotated class which is just a proxy/forward to
  • Transactional annotation implentation class

What happens is the following

Call 1:

  1. Transaction gets created
  2. class method gets called
  3. result cached & returned

Call 2:

  1. Transaction gets created
  2. Cached result gets returned

The prefered result should be:

Call 1:

  1. Transaction gets created
  2. class method gets called
  3. result cached & returned

Call 2:

  1. Cached result gets returned
  • 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-06-04T06:29:30+00:00Added an answer on June 4, 2026 at 6:29 am

    You need to change relative order of @Transactional and @Cacheable aspects.

    It can be configured using order attribute of <tx:annotation-driven> and <cache:annotation-driven>. See 8.2.4.7 Advice ordering for the meaning of order values.

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

Sidebar

Related Questions

While doing some experiment on serialization, I noticed that my object name is lost
While doing some refactoring I've found that I'm quite often using a pair or
While doing performance testing on windows, i usually use perfmon. But when i put
I get this problem while doing some experiment with set . I use a
Correct me if im wrong but while doing a foreach an IEnumerable<T> creates garbage
While doing a minor school project, I just noticed a difference in the range
I want to display a progress bar while doing some work, but that would
I want to handle different problems, while doing database operations, differently. e.g. The operation
While doing development on a .js file I'd like to just refresh that file
While doing concurrent programming I need to tell the compiler/optimizer that it may not

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.