File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Object Relational Mapping and the fly likes connection problem in mysql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "connection problem in mysql" Watch "connection problem in mysql" New topic

connection problem in mysql

Khushwinder Chahal
Ranch Hand

Joined: Oct 03, 2007
Posts: 128
Hi All,

I have done pagination with hibernate and jsp pager tag lib. It is working fine.
The queries i am using are as follow:

Now i am testing it against 1,00,000 records in the database(mysql).
But when i do the rigrous testing i.e. by clicking on the next button so many times and very fastly i get the following err :

My hibernate.xml file is given below:

Paul Sturrock

Joined: Apr 14, 2004
Posts: 10336

Sounds like you are probably not closing your connections properly (or since this is Hibernate your Sessions).

JavaRanch FAQ HowToAskQuestionsOnJavaRanch
Rahul Babbar
Ranch Hand

Joined: Jun 28, 2008
Posts: 210
You are creating the transactions but are not commiting or rolling them back.
In the "Method for getting employees based on query",
after line 12.

Rahul Babbar
Khushwinder Chahal
Ranch Hand

Joined: Oct 03, 2007
Posts: 128
Hi All,
Thanks a lot for your replies.

I solved this problem with the following modification in my code :

The code which is commented is replaced by the static block.

Thanks and Regards.
I agree. Here's the link:
subject: connection problem in mysql
It's not a secret anymore!