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

1 2 3 4 5 6 7 8 9 10 11 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.

Environment

Oracle, Java 7

Status

Assignee

Brett Meyer

Reporter

Kai Prünte

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Components

Affects versions

4.3.0.Final

Priority

Major