# Open cursors are not released

**URL:** <https://discourse.hibernate.org/t/open-cursors-are-not-released/1277>\
**Category:** Hibernate ORM\
**Created:** [August 24, 2018, 5:55am UTC](https://discourse.hibernate.org/t/open-cursors-are-not-released/1277 "2018-08-24T05:55:07Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![kullboys](https://avatars.discourse-cdn.com/v4/letter/k/cdc98d/32.png) [@kullboys](https://discourse.hibernate.org/u/kullboys)\
**Post date:** [August 24, 2018, 5:55am UTC](https://discourse.hibernate.org/t/open-cursors-are-not-released/1277/1 "2018-08-24T05:55:07Z")

</div>

Hello everyone  
Injection of entitymanager using @ Persistencecontext in spring ,for saving, extraction of data cursor is open in database even after returning from @Transactional method in-service class from where I am calling methods in dao layer like em.merge() calling em.close() after each database operations in a finally block open cursors are not released in database.Due to which I am facing maximum open cursors exceeded exception.  
Thanks[.](http://journal.umy.ac.id/index.php/jsp/user/viewPublicProfile/33778)

---

<div class="post-metadata">

**Author:** ![vlad](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.hibernate.org/vlad/32/658_2.png) [@vlad](https://discourse.hibernate.org/u/vlad)\
**Post date:** [August 24, 2018, 5:57am UTC](https://discourse.hibernate.org/t/open-cursors-are-not-released/1277/2 "2018-08-24T05:57:14Z")

</div>

Try to replicate it with this [Hibernate test case](http://in.relation.to/2016/01/14/hibernate-jpa-test-case-template/) to isolate the problem.

If you can replicate it, you should open a Jira issue. If you cannot replicate it, it’s not a Hibernate issue, being a usability issue.
