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

Bug 332683

Summary: Problems with ClientSession connections
Product: z_Archived Reporter: Andrei Ilitchev <andrei.ilitchev>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3    
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
proposed patch
none
Updated patch none

Description Andrei Ilitchev CLA 2010-12-15 15:12:24 EST
Two problems were observed:
1. Attempt to use non pooled connection would fail with DatabaseException.databaseAccessorNotConnected;
2. postAcquireConnection events were sometimes risen too late, sometimes risen many times.
The problems were introduced in 2.2 with multiple write connections on a single ClientSession support.
Comment 1 Andrei Ilitchev CLA 2010-12-15 15:21:04 EST
Created attachment 185263 [details]
proposed patch

- postAcquireConnection events called before any usage of connection (including begin transaction) and there are no duplicate calls;
- non pooled connection case - connect before adding connection to the ClientSession;
- renamed  postConnectExternalConnection and preDisconnectExternalConnection to postAcquireConnection and preReleaseConnection respectively. Use these methods consistently in all cases to rise these events.
Comment 2 Andrei Ilitchev CLA 2010-12-17 16:46:15 EST
Created attachment 185462 [details]
Updated patch
Comment 3 Andrei Ilitchev CLA 2010-12-17 16:49:47 EST
Updated patch checked into trunk (2.2).
Comment 4 Eclipse Webmaster CLA 2022-06-09 10:23:42 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink