aspose file tools*
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


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "connection problem in mysql" Watch "connection problem in mysql" New topic
Author

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:



Khushwinder
Paul Sturrock
Bartender

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",
do
"session.getTransaction().commit();"
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.
 
jQuery in Action, 2nd edition
 
subject: connection problem in mysql
 
Similar Threads
getting this error when connecting to databse through hibernate
1:M lost getting lists
hibernate- Dialect mapping for JDBC
Error connecting to MSSQL Server from Hibernate
Hibernate mapping