PooledLoOptimizer in conjunction with SequenceStyleGenerator is not thread-safe

Description

The generate method of the PooledLoOptimizer introduced in 3.6.1 is not synchronized in difference to the one in PooledOptimizer and in other Optimizer implementations. The problem is that some IdentifierGenerator implementations have themselve a synchronized generate method (like SequenceHiLoGenerator e.g.) and some don't, like the new SequenceStyleGenerator.
According to the javadoc IdentifierGenerator implementations have to be thread-safe. Now I don't know if there is any agreement among the developers whether this thread-safety is to be achieved in the IdentifierGenerator itself or in the Optimizer most of them delegate to but what I know is that SequenceStyleGenerator in conjunction with PooledLoOptimizer is not thread-safe because neither of them guards against concurrent access in any way.

Activity

Show:

Strong LiuJuly 10, 2012 at 6:28 PM

pull request merged, thanks

Philippe MarschallJune 9, 2012 at 7:51 PM

pull request against master branch
https://github.com/hibernate/hibernate-orm/pull/350
pull request against 3.6 branch
https://github.com/hibernate/hibernate-orm/pull/351
should be closed as a duplicate of this bug

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

Created February 14, 2011 at 5:19 PM
Updated December 19, 2013 at 9:26 PM
Resolved July 10, 2012 at 6:28 PM