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

Bug 358612

Summary: ClientSession:releaseReadConnection accidentally releases write connections
Product: z_Archived Reporter: Michael Pflueger <michael.pflueger>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P2 CC: chanro, tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows XP   
Whiteboard:

Description Michael Pflueger CLA 2011-09-22 11:47:48 EDT
Build Identifier: 2.3.1 Nightly

I get a DataAccessor not connected exception when using cursors in a transaction context repeatedly.
My write connection is closed after 2 queries and I get said DataAccessor disconnected exception. I also think I found the bug in the code, in ClientSession.java, method releaseReadConnection.

        // If the cursor's connection is the write connection, then do not release it.
        if ((this.writeConnections != null) && this.writeConnections.containsKey(connection)) {

However, the last containsKey should probably be containsValue - I changed it and the bug disappears here.

Reproducible: Always

Steps to Reproduce:
1. use cursors in a transaction-environment
2. query several times, the third fails, maybe depending on the number of setup write connections
3.
Comment 1 Tom Ware CLA 2011-10-31 13:30:54 EDT
Setting target and priority.  See the following page for the meanings of these fields:

http://wiki.eclipse.org/EclipseLink/Development/Bugs/Guidelines

Community: Please vote for this bug if it is important to you.  Votes are one of the main criteria we use to determine which bugs to fix next.
Comment 2 Eclipse Webmaster CLA 2022-06-09 10:31:36 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink