Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 332683 - Problems with ClientSession connections
Summary: Problems with ClientSession connections
Status: CLOSED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Eclipselink (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Nobody - feel free to take it CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-12-15 15:12 EST by Andrei Ilitchev CLA
Modified: 2022-06-09 10:23 EDT (History)
0 users

See Also:


Attachments
proposed patch (32.47 KB, patch)
2010-12-15 15:21 EST, Andrei Ilitchev CLA
no flags Details | Diff
Updated patch (32.97 KB, patch)
2010-12-17 16:46 EST, Andrei Ilitchev CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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