This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

connection problem in mysql

 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like you are probably not closing your connections properly (or since this is Hibernate your Sessions).
 
Rahul Babbar
Ranch Hand
Posts: 210
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Khushwinder Chahal
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic