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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T02:54:45+00:00 2026-05-25T02:54:45+00:00

I have used PROPAGATION_REQUIRED declarative transaction management approach for my Spring+Hibernate+Struts application. I can

  • 0

I have used PROPAGATION_REQUIRED declarative transaction management approach for my Spring+Hibernate+Struts application.
I can catch the StaleObjectException(intended) in the place where the service call is made (where the transaction starts). There are nested calls Foo1, Foo2, Foo3 in the service method which perform the updates. I want to catch the exception in these methods. How can I do so? Any alternatives or workarounds?

  • 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-25T02:54:45+00:00Added an answer on May 25, 2026 at 2:54 am

    You shouldn’t catch this exception. From the Hibernate reference documentation:

    If the Session throws an exception, including any SQLException,
    immediately rollback the database transaction, call Session.close()
    and discard the Session instance. Certain methods of Session will not
    leave the session in a consistent state. No exception thrown by
    Hibernate can be treated as recoverable.

    This means that other than catching the exception to transform it or wrap it into another kind of exception, catching the exception won’t help you: using the session after won’t work as expected anyway.

    See How to deal with locks (JPA)? for another question where optimistic locking exception handling is discussed.

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

Sidebar

Related Questions

I have used geocoder in my ruby on rails application for a while but
I am using Spring Framework transactional annotations for transaction managing and I have an
I am using annotation based declarative approach for spring aop. sample code ClassA{ @Transactional(readOnly
My colleague and I have a web application that uses Spring 3.0.0 and JPA
I have used Application.ThreadException and AppDomain.CurrentDomain.UnhandledException before but usually I only use this for
I have the following setup. Spring 3.0.5 Hibernate 3.5.6 MySql 5.1 To save a
I have used the silverlight control in CRM 2011.It also published on form but
We have used Shibboleth to authenticate users. It works great. The issue is that
I have used some jquery components in my web site, Suddenly i'm getting an
I have used a plugin that uses prototype js, it's working fine but the

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.