Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 370855 - connection leak with exclusive connections and read-only queries
Summary: connection leak with exclusive connections and read-only queries
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-07 11:51 EST by James Sutherland CLA
Modified: 2022-06-09 10:24 EDT (History)
0 users

See Also:


Attachments
patch (11.68 KB, patch)
2012-02-07 13:03 EST, James Sutherland CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description James Sutherland CLA 2012-02-07 11:51:55 EST
If you have exclusive-connection.mode = Always, then read-only queries can leak connections.

The issue is a ClientSession is created, but never released.
JPA needs to release the client session.
Also ServerSession executeQuery acquires a ClientSession and never releases it.

Fix will hold readOnlySession in EntityManagerImpl and release on close.
Comment 1 James Sutherland CLA 2012-02-07 11:53:47 EST
Ref Oracle bug#13690092
Comment 2 James Sutherland CLA 2012-02-07 12:03:07 EST
SVN trunk commit: Bug#370855 exclusive connection leaking

https://bugs.eclipse.org/bugs/show_bug.cgi?id=370855

Fixes issue with exclusive-connection.mode Always and read-only queries leaking connections.

Code review: Andrei

Changes:
-	Added readOnlySession to EntityManagerImpl to hold read-only ClientSession to ensure it is released on close.
-	Fixed ServerSession to release ClientSession allocated for query execution.
-	Fixed batch writing logging to log with correct connection id.
Comment 3 James Sutherland CLA 2012-02-07 13:03:28 EST
Created attachment 210673 [details]
patch
Comment 4 James Sutherland CLA 2012-02-22 10:32:31 EST
fixed
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:24:57 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink