We encounter a problem when we have subclasses of events that use GenerationType.TABLE to generate the primary key, and when we restart the servers, we get repeated primary key errors.
We use SQL Server and Hibernate version 3.5.1-Final.
Here's what the Hibernate annotations look like:
@Entity @Inheritance(strategy = InheritanceType.TABLE_PER_CLASS) public abstract class Event { @Id @GeneratedValue(strategy = GenerationType.TABLE) private long eventID;
we do not specify allocize, so we use the default value. The hibernation sequence table is growing, but it seems that when it is restarted, it reuses the identifiers already in use.
java sql sql-server orm hibernate
Dougnukem
source share