Good day.
Thank you for your reply. I configured hibernate with c3p0 and problem was solved (c3p0 rolls back incomplete transactions).
This issue can be closed now.