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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T22:11:41+00:00 2026-06-15T22:11:41+00:00

While stress testing my JPA based DAO layer (Running 500 simultanious updates at the

  • 0

While stress testing my JPA based DAO layer (Running 500 simultanious updates at the same time each in a separate thread). I encountered following – system always stuck unable to make any progress.

The problem was, that there were no available connections at some point for any thread, so no running thread could make any progress.

I have investigated this for a while and the root was REQUIRES_NEW annotation on add method in one of my JPA DAO's.

So the scenario was:

  1. Test starts acquiring new Connection from ConnectionPool to start transaction.
  2. After some initial phase, I call add on my DAO, causing it to request another Connection from ConnectionPool which there are no, because all the Connections by that time, were taken by parallel running tests.

I tried to play with DataSource configurations

  1. c3p0 stucks
  2. DBCP stucks
  3. BoneCP stucks
  4. MySQLDataSource fail some requests, with error – number of connections exceeded allowed.

Although I solved it by getting read of REQUIRES_NEW, with which all DataSources worked perfectly, still the best result seems to be of MySQLDataSource, since it did not stuck and just fail:)

So it seems you should not use REQUIRES_NEW at all, if you expect high throughput.

And my question:

Is there a configuration for either DataSources that could prevent this REQUIRES_NEW problem?


I played with checkout timeout in c3p0, and tests started to fail, as expected.

  • 2 sec – 8 % passed
  • 4 sec – 12 % passed
  • 6 sec – 16 % passed
  • 8 sec – 26 % passed
  • 10 sec – 34 % passed
  • 12 sec – 36 % passed
  • 14/16/18 sec – 40 % passed

This is highly subjective ofcourse.

MySQLDataSource with plain configurations gave 20% of passed tests.

  • 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-15T22:11:43+00:00Added an answer on June 15, 2026 at 10:11 pm

    What about configuring a timeout for obtaining the connection? If the connection can’t be obtained in say 2 seconds, the pool will abort and throw an exception.

    Also note that REQUIRES is more typical. Often you’d want a call chain to share a transaction instead of starting a new transaction for each new call in a chain.

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

Sidebar

Related Questions

While stress testing prototype of our brand new primary system, I run into concurrent
I am stress testing my production server which is 1-Core linux server. While stress
While developing an application using gwt in ecliplse crashed. Now the server is running
While running my application the user has the possibility to show or hide a
i'm stress testing 2 different projects: one is proxsmtpd - smtp proxy written in
I built two separate Firefox extensions which are fundamentally incompatible with each other. The
This isn't a question of what stress testing tools are out there. I'm afraid
My small stress test, which allocates random length arrays (100..200MB each) in a loop,
While looking into Can you have a incrementor and a decrementor on the same
While debugging and keep pressing F5, if the source code does not exist, eclipse

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.