Collectionread causes open cursors

Description

The access to a one-to-many property executes a query. The underlying cursor will not be closed during the session:

Reader.java

for (int i = 0; i < 2500; i++) { Query q = em.createQuery("from Department dep where dep.name = :name"); q.setParameter("name", "dep_" + i); Department dep = (Department) q.getSingleResult(); System.out.println(dep.getName()); Set<Employee> employees = dep.getEmployees(); for (Employee employee : employees) { // } }

In my environment after 1999 loops I get a ORA-01000: maximum open cursors exceeded. My DB is configured to 2000 cursors.

Attachments

4
  • 09 Jan 2014, 03:22 PM
  • 20 Dec 2013, 01:05 PM
  • 20 Dec 2013, 01:05 PM
  • 20 Dec 2013, 12:29 PM

Activity

Show:

Sanne Grinovero January 20, 2014 at 6:14 PM

sorry I misread the forum post, it's indeed not affecting 4.2.8.

Sanne Grinovero January 20, 2014 at 6:13 PM

Brett Meyer January 20, 2014 at 6:06 PM

, have a link w/ specific questions? Maybe there's a separate issue. Multiple commenters, here, mentioned that it wasn't an issue in 4.2.8. The specific fix involved code that was new in 4.3.

Sanne Grinovero January 20, 2014 at 12:48 PM

from the forums I'm understanding that this problem affect ORM 4.2.x too, should we backport it?

Brett Meyer January 9, 2014 at 7:05 PM

Thanks for the AbstractLoadPlanBasedLoader patch – that was correct. The JdbcCoordinatorImpl fix would not work – releasing ResultSets and Statements must happen separately.

Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

Created December 20, 2013 at 12:26 PM
Updated May 5, 2022 at 10:46 AM
Resolved May 5, 2022 at 10:46 AM

Flag notifications