Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 370855

Summary: connection leak with exclusive connections and read-only queries
Product: z_Archived Reporter: James Sutherland <jamesssss>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: RESOLVED FIXED QA Contact:
Severity: major    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
patch none

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