The annotation configuration for the ID is the following:
Code:
@Basic
@Id
@javax.persistence.SequenceGenerator(name = "my_id_sequence", sequenceName = "my_id_seq", allocationSize = 1)
@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "my_id_sequence")
@Column(name = "id")
And I notice the last value of the sequence is incremented after the exception. And something is very interesting here. If I place a try block around the save(), the entity will be saved. At this point, I can conclude that it is a bug in Hibernate 3.3.2.GA.