Community
Participate
Working Groups
If a seperate sequence connection pool is configured through the 'eclipselink.connection-pool.sequence.*' attribute(s) in the persistence.xml, it will not be used. It seem's that the SequenceManager use the wrong allocation strategy (Preallocation_Transaction_NoAccessor_State) also if a sequence connection pool is configured in persistence.xml. I think the origin lies in the implementation of the EntityManagerSetupImpl.updateConnectionSettings method which not set the SequencingControl.setShouldUseSeparateConnection flag to true. That causing that the connectionHandler will be set to null in the SequencingManager.onConnectInternal method. If connectionHandler is set to null the wrong strategy (Preallocation_Transaction_NoAccessor_State) will be used instead of Preallocation_Transaction_Accessor_State. I added a patch that sets the setShouldUseSeparateConnection flag in the EntityManagerSetupImpl.updateConnectionSettings. Iam not sure if this causing any unwanted side effects. But maybe it can be used as a starting point for a developer with more insights. Greeting Luca P.S. It seems that the old-style (deprecated as of EclipseLink 2.2) configuration 'eclipselink.jdbc.sequence-connection-pool.*' is not affected and can be used as workaround.
Created attachment 206893 [details] patch
Build Identifier: 2.3.0.v20110604-r9504 Reproducible: Always Steps to Reproduce: 1. Add the property 'eclipselink.connection-pool.sequence.nonJtaDataSource' that points to a valid datasource to persistence.xml. 2. Set eclipselink.logging.level to FINEST in persistent.xml. 3. Execute code that needs sequence allocation (f.e. persist an entity that use table sequencing for the id field). 4. You can see that the default connection pool is used for sequence alocation in the log. Something like: ... Connection acquired from connection pool [default]. FINEST: Execute query DataModifyQuery(name="SEQUENCE" sql="UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + #PREALLOC_SIZE WHERE SEQ_NAME = #SEQ_NAME") FINEST: reconnecting to external connection pool FINE: UPDATE SEQUENCE SET SEQ_COUNT = SEQ_COUNT + ? WHERE SEQ_NAME = ? bind => [50, SEQ_GEN] FINEST: Execute query ValueReadQuery(name="SEQUENCE" sql="SELECT SEQ_COUNT FROM SEQUENCE WHERE SEQ_NAME = #SEQ_NAME") FINE: SELECT SEQ_COUNT FROM SEQUENCE WHERE SEQ_NAME = ? bind => [SEQ_GEN] FINEST: local sequencing preallocation for SEQ_GEN: objects: 50 , first: 1, last: 50 ...
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.
The Eclipselink project has moved to Github: https://github.com/eclipse-ee4j/eclipselink