Is Hibernate Identity Generator single?
1 answer
Hibernate has many ID generators and IDENTITY SEQUENCE and TABLE use the database to generate a new ID value. Synchronization takes place in the database using locks (soft-locks for IDENTITY and SEQUENCE and hard locks for TABLE).
Generators are stored in SessionFactory
, so they are shared by everyone Sessions
.
+1
source to share