I hope it's a problem on my side , but here is what I see in hibernate code ...
1. stack trace for the
SequenceStyleGenerator.generate method:
Code:
at org.hibernate.id.enhanced.SequenceStyleGenerator.generate( ... )
at org.hibernate.event.def.AbstractSaveEventListener.saveWithGeneratedId(AbstractSaveEventListener.java:99)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.saveWithGeneratedOrRequestedId(DefaultSaveOrUpdateEventListener.java:187)
at org.hibernate.event.def.DefaultSaveEventListener.saveWithGeneratedOrRequestedId(DefaultSaveEventListener.java:33)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.entityIsTransient(DefaultSaveOrUpdateEventListener.java:172)
at org.hibernate.event.def.DefaultSaveEventListener.performSaveOrUpdate(DefaultSaveEventListener.java:27)
at org.hibernate.event.def.DefaultSaveOrUpdateEventListener.onSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:70)
at org.hibernate.impl.SessionImpl.fireSave(SessionImpl.java:535)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:523)
at org.hibernate.impl.SessionImpl.save(SessionImpl.java:519)
I don't see synchronization on SequenceStyleGenerator instance on the stack.
2. SequenceStyleGenerator instance is bound to SessionFactory not Session, so it is shared across multiple threads.
3. Only one instance of SequenceStyleGenerator is created per entity, so again instance is shared across multiple threads per entity type.
what am i missing ?
tnx.