It is quite simple, make sure turn autcommit off for your database Well, first of all, your code is actually read user information from database, not write to database, so you do not have to use transaction and rollback method. Secondly, when you update or insert a record to the database, when you use transaction, the database should turn autcommit off already, but I am not sure do you use your own connection pool or not. Please check your connection pool as well. Thirdly, when you have an error, make sure you always close your hibernate connection. When you catch an Exception, please use the finally to close the hibernate session or connection. Otherwise you probably will run out of connections. Please put your detailed error stack trace here if you need more tips forthis problem