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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T07:56:19+00:00 2026-06-04T07:56:19+00:00

Exceptions thrown by Hibernate are unchecked and from what I’ve read elsewhere it seems

  • 0

Exceptions thrown by Hibernate are unchecked and from what I’ve read elsewhere it seems that they are not supposed to be caught in code. However, this means that when for example a temporary database error occurs, the thread in which it occurred dies and our application becomes unresponsive. How should it be done?

Example exceptions that occur:

javax.persistence.PersistenceException
Caused by: org.hibernate.exception.GenericJDBCException: could not insert
Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction

This happens when the application has been running for hours or days.

Much of what I’ve read talks about how to use Hibernate when integrated into Spring or something similar. Thus, each web request starts a new thread and if that thread dies it only affects that one web request. But in the case of a standalone Java application, how should we deal with it?

  • 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-04T07:56:20+00:00Added an answer on June 4, 2026 at 7:56 am

    There is nothing wrong with catching a RuntimeException. It being unchecked is just to give you the option not to.

    If you have a specific strategy in mind for handling the exception (like trying again, or triggering something else in your app logic), by all means catch it!

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

Sidebar

Related Questions

What are the sql exceptions will thrown by using the following function: Read Update
We all know the effects that lots of thrown exceptions can have over the
While designing a new WPF application I noticed exceptions not being thrown during data
I was hoping to implement a single ExceptionController to handle exceptions that are thrown
Is there anyway to determine the Exceptions that can be thrown by methods in
I want to catch exceptions thrown by classes implementing Processor interface. In aspect I
First off I run my applications with exceptions thrown on any error (handled or
I have a HttpModule in C# 2.0 which handles exceptions thrown. Whenever the exception
I've got a WCF service which swallows up exceptions thrown in called methods and
I'm writing a little developer tool which will (among other things) display exceptions thrown

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.