This week's book giveaway is in the Jobs Discussion forum.
We're giving away four copies of Java Interview Guide and have Anthony DePalma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes GenericJDBCException: Cannot open connection Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "GenericJDBCException: Cannot open connection" Watch "GenericJDBCException: Cannot open connection" New topic

GenericJDBCException: Cannot open connection

Sham Phadtale
Ranch Hand

Joined: Jul 29, 2008
Posts: 75
Hi I am updating MySQL database from Swing Client and jboss-5.1.0.GA as a server. The bean which I want to update is EJB3 enity bean.
While updating i am getting following exception. When I update less no of rows I did not get it, but if no of rows increase I get this exception. Please anyone have any clue about how to get rid this exception.
I am sorry as I dont know which tag should use to copy stack trace, I am using code tag..
Ifteqar Ahmed
Ranch Hand

Joined: May 02, 2011
Posts: 85


There is some hard limit on the database server about the maximum number of concurrent connections. You've reaching this limit, when you try and get another connection it fails.

Please check your Configuration File (Ex - mysql-ds.xml) file for the maximum and Minimum number of Concurrent Connections to the Database.

Sham Phadtale
Ranch Hand

Joined: Jul 29, 2008
Posts: 75
Do you want to say pool size? Following is my *-ds.xml file.

Do I need to add some annotations like TransactionType(?) to my code which is updating database? What should I do to fix the issue?
It is sorta covered in the JavaRanch Style Guide.
subject: GenericJDBCException: Cannot open connection
It's not a secret anymore!