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

The Archive Base Latest Questions

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

There are two functions A and B which are defined with Transactional annotation. I

  • 0

There are two functions A and B which are defined with Transactional annotation.

I am calling B from A.

@Transactional(value=Constants.READ_WRITE_REQUEST)
public int A(....){
    B();
}

@Transactional(propagation=Propagation.REQUIRES_NEW,value=Constants.READ_WRITE_REQUEST)
public int B(....){
     C();        
}

@Transactional(value=Constants.READ_WRITE_REQUEST)
public int C(....){
    ...
}

It was resulting into

Caused by: java.sql.SQLException: Lock wait timeout exceeded; try restarting transaction

    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1055)

    at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:956)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3491)

    at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3423)

    at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1936)

    at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2060)

    at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2542)

I removed the Propagation.REQUIRES_NEW from the function B and problem got resolved.

Is it because old transaction was holding the lock and new one was created?
Any thoughts on this?

  • 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-28T02:59:55+00:00Added an answer on May 28, 2026 at 2:59 am

    Looks like some kind of dead lock, two transactions, the outer (from A) and the inner (from B) have a lock/try to lock the same resource.

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

Sidebar

Related Questions

Are there any PHP equivalents for these two functions? I tried searching but couldn't
I want these two print functions to do the same thing: unsigned int Arraye[]
I'm trying to use the StringEscapeUtils.escapeXML() function from org.apache.commons.lang... There are two versions of
Is there a function in c# that takes two 32 bit integers (int) and
Background I am writing an application which has two distinct functions. Load a GPX
I've defined a lot of functions (say, 100+), each of which do a specific
I have a ColdFusion function foo which takes three args, and the second two
I have these two functions (with Point2D & LineVector (has 2 Point2D member variables)
What is the difference between these two functions? 1: $(document).ready(function myfunc() { function dosomething()
Is there a PHP function that grabs the string in between two characters. For

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.