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

Bug 366201

Summary: Wrong default initialization of sequence connection pool
Product: z_Archived Reporter: Krum Tsvetkov <krum.tsvetkov>
Component: EclipselinkAssignee: Nobody - feel free to take it <nobody>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3 CC: tom.ware
Version: unspecified   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Whiteboard:
Attachments:
Description Flags
Patch to fix default initialization none

Description Krum Tsvetkov CLA 2011-12-09 10:13:48 EST
We experienced a problem while using the sequence connection pool. After some debugging, it turned out that there seems to be a problem with the initialization of the maxPoolSize if no value is explicitly specified.

The code (org.eclipse.persistence.internal.sequencing.SequencingManager, createConnectionHandler()) currently is:
                    if (getMaxPoolSize() == -1) {
                        setMinPoolSize(2);
                    }

I've attached a small patch (two letters :)) which should fix it.

The problem which we observed was, that after a disconnection of the DB the sequence pool couldn't recover.
In the ConnectionPool class, acquireConnection() there is a check like this:
            if ((this.connectionsUsed.size() + this.connectionsAvailable.size()) < this.maxNumberOfConnections) {

which can't go true with a -1 for maxNumberOfConnections

We worked around the problem by setting the eclipselink.jdbc.sequence-connection-pool.max property explicitly.
Comment 1 Krum Tsvetkov CLA 2011-12-09 10:15:31 EST
Created attachment 208166 [details]
Patch to fix default initialization
Comment 2 Tom Ware CLA 2011-12-14 15:54:24 EST
Let us know if you need help with verifying the patch.
Comment 3 Krum Tsvetkov CLA 2011-12-20 09:12:10 EST
Hi Tom,

I think I will need some help.
I am trying for some time now to build and test EclipseLink locally.
I am following the description http://wiki.eclipse.org/EclipseLink/Building but it seems to be somewhat outdated.

I managed to get the maven/tycho build, but from what I understand, in order to run the tests I have to first build the Eclipselink jar, and then run the tests (using the ant build).

I tried following the description and specify external folder with libraries like bnd and junit, however, I still get this (after a succesfull maven buld):

I call 'ant -f antbuild.xml build-eclipselink-jar'
and get:
bnd-package:
  [taskdef] Could not load definitions from resource aQute/bnd/ant/taskdef.properties. It could not be found.

I define the following properties in my <user-home>/build.properties:
extensions.depend.dir=C:/develop/EclipseLink/extension.lib.external/extension.lib.external
bndtool.lib=bnd-0.0.401.jar
junit.lib=C:/develop/EclipseLink/extension.lib.external/extension.lib.external/junit-4.10.jar

This was for example one of the outdated infos on the build page, there the property is still named bndtool.jar. I also tried giving the full path to it, however without success.

Is there some newer description? Or an example? May be can see an example in some of the files used to build at Eclipse, but I couldn't find it on my onw so far.
Comment 4 Krum Tsvetkov CLA 2011-12-20 11:00:03 EST
I managed to get the build working properly. Now I can start the different test groups. I will share the results.
Tom, thanks for helping me!
Comment 5 Eclipse Webmaster CLA 2022-06-09 10:14:12 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink
Comment 6 Eclipse Webmaster CLA 2022-06-09 10:33:56 EDT
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink