I have an application deployed on Jboss 7.1.0 FINAL in which I have an entity that when persisting it appears to be caught in an infinite loop when selecting the sequence for the id. @Entity @Table(name = "FAKE_TABLE", schema = "FAKE_SCHEMA") public class Fake implements Serializable { .... @Id @SequenceGenerator(name = "FAKE_SEQ", sequenceName = "FAKE_SCHEMA.SEQUENCE_SEQ", allocationSize = 1) @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "FAKE_SEQ") @Column(name = "FAKEKEY", unique = true, nullable = false, precision = 22, scale = 0) public Integer getFakeKey() { return this.fakeKey; } then in some code .... Fake fake = new Fake(); entityManager.persist(fake ); ..... Then the looping: 14:21:19,512 INFO [stdout] (http--127.0.0.1-8080-5) Hibernate: 14:21:19,512 INFO [stdout] (http--127.0.0.1-8080-5) select 14:21:19,512 INFO [stdout] (http--127.0.0.1-8080-5) FAKE_SCHEMA.SEQUENCE_SEQ.nextval 14:21:19,513 INFO [stdout] (http--127.0.0.1-8080-5) from 14:21:19,513 INFO [stdout] (http--127.0.0.1-8080-5) dual 14:21:19,607 INFO [stdout] (http--127.0.0.1-8080-5) Hibernate: 14:21:19,607 INFO [stdout] (http--127.0.0.1-8080-5) select 14:21:19,607 INFO [stdout] (http--127.0.0.1-8080-5) FAKE_SCHEMA.SEQUENCE_SEQ.nextval 14:21:19,608 INFO [stdout] (http--127.0.0.1-8080-5) from 14:21:19,609 INFO [stdout] (http--127.0.0.1-8080-5) dual 14:21:19,705 INFO [stdout] (http--127.0.0.1-8080-5) Hibernate: 14:21:19,706 INFO [stdout] (http--127.0.0.1-8080-5) select 14:21:19,706 INFO [stdout] (http--127.0.0.1-8080-5) FAKE_SCHEMA.SEQUENCE_SEQ.nextval 14:21:19,707 INFO [stdout] (http--127.0.0.1-8080-5) from 14:21:19,709 INFO [stdout] (http--127.0.0.1-8080-5) dual 14:21:19,814 INFO [stdout] (http--127.0.0.1-8080-5) Hibernate: 14:21:19,815 INFO [stdout] (http--127.0.0.1-8080-5) select 14:21:19,816 INFO [stdout] (http--127.0.0.1-8080-5) FAKE_SCHEMA.SEQUENCE_SEQ.nextval 14:21:19,816 INFO [stdout] (http--127.0.0.1-8080-5) from 14:21:19,817 INFO [stdout] (http--127.0.0.1-8080-5) dual 14:21:19,912 INFO [stdout] (http--127.0.0.1-8080-5) Hibernate: 14:21:19,912 INFO [stdout] (http--127.0.0.1-8080-5) select 14:21:19,912 INFO [stdout] (http--127.0.0.1-8080-5) FAKE_SCHEMA.SEQUENCE_SEQ.nextval 14:21:19,913 INFO [stdout] (http--127.0.0.1-8080-5) from 14:21:19,913 INFO [stdout] (http--127.0.0.1-8080-5) dual 14:21:20,008 INFO [stdout] (http--127.0.0.1-8080-5) Hibernate: 14:21:20,008 INFO [stdout] (http--127.0.0.1-8080-5) select 14:21:20,009 INFO [stdout] (http--127.0.0.1-8080-5) FAKE_SCHEMA.SEQUENCE_SEQ.nextval 14:21:20,009 INFO [stdout] (http--127.0.0.1-8080-5) from 14:21:20,010 INFO [stdout] (http--127.0.0.1-8080-5) dual 14:21:20,104 INFO [stdout] (http--127.0.0.1-8080-5) Hibernate: 14:21:20,104 INFO [stdout] (http--127.0.0.1-8080-5) select 14:21:20,104 INFO [stdout] (http--127.0.0.1-8080-5) IDENTITY.SEQUENCE_SEQ.nextval 14:21:20,105 INFO [stdout] (http--127.0.0.1-8080-5) from 14:21:20,105 INFO [stdout] (http--127.0.0.1-8080-5) dual 14:21:20,200 INFO [stdout] (http--127.0.0.1-8080-5) Hibernate: 14:21:20,200 INFO [stdout] (http--127.0.0.1-8080-5) select 14:21:20,200 INFO [stdout] (http--127.0.0.1-8080-5) FAKE_SCHEMA.SEQUENCE_SEQ.nextval 14:21:20,201 INFO [stdout] (http--127.0.0.1-8080-5) from 14:21:20,201 INFO [stdout] (http--127.0.0.1-8080-5) dual 14:21:20,298 INFO [stdout] (http--127.0.0.1-8080-5) Hibernate: 14:21:20,298 INFO [stdout] (http--127.0.0.1-8080-5) select 14:21:20,298 INFO [stdout] (http--127.0.0.1-8080-5) FAKE_SCHEMA.SEQUENCE_SEQ.nextval 14:21:20,299 INFO [stdout] (http--127.0.0.1-8080-5) from 14:21:20,299 INFO [stdout] (http--127.0.0.1-8080-5) dual 14:21:20,394 INFO [stdout] (http--127.0.0.1-8080-5) Hibernate: 14:21:20,394 INFO [stdout] (http--127.0.0.1-8080-5) select 14:21:20,394 INFO [stdout] (http--127.0.0.1-8080-5) IDENTITY.SEQUENCE_SEQ.nextval 14:21:20,395 INFO [stdout] (http--127.0.0.1-8080-5) from 14:21:20,395 INFO [stdout] (http--127.0.0.1-8080-5) dual 14:21:20,491 INFO [stdout] (http--127.0.0.1-8080-5) Hibernate: 14:21:20,491 INFO [stdout] (http--127.0.0.1-8080-5) select 14:21:20,492 INFO [stdout] (http--127.0.0.1-8080-5) FAKE_SCHEMA.SEQUENCE_SEQ.nextval 14:21:20,492 INFO [stdout] (http--127.0.0.1-8080-5) from 14:21:20,493 INFO [stdout] (http--127.0.0.1-8080-5) dual 14:21:20,589 INFO [stdout] (http--127.0.0.1-8080-5) Hibernate: 14:21:20,590 INFO [stdout] (http--127.0.0.1-8080-5) select 14:21:20,590 INFO [stdout] (http--127.0.0.1-8080-5) FAKE_SCHEMA.SEQUENCE_SEQ.nextval 14:21:20,591 INFO [stdout] (http--127.0.0.1-8080-5) from 14:21:20,591 INFO [stdout] (http--127.0.0.1-8080-5) dual The sequence is getting incremented but the entity is never persisted it just keeps going in the above loop. There are other persist transaction in the application which are working. This is particular to this entity only. Version info: <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-entitymanager</artifactId> <version>3.6.9.Final</version> <exclusions> <exclusion> <artifactId>cglib</artifactId> <groupId>cglib</groupId> </exclusion> <exclusion> <artifactId>javassist</artifactId> <groupId>javassist</groupId> </exclusion> <exclusion> <artifactId>xml-apis</artifactId> <groupId>xml-apis</groupId> </exclusion> <exclusion> <artifactId>jta</artifactId> <groupId>javax.transaction</groupId> </exclusion> </exclusions> </dependency> <dependency> <groupId>org.hibernate</groupId> <artifactId>hibernate-validator</artifactId> <version>3.1.0.GA</version> <exclusions> <exclusion> <artifactId>hibernate-commons-annotations</artifactId> <groupId>org.hibernate</groupId> </exclusion> <exclusion> <artifactId>hibernate-core</artifactId> <groupId>org.hibernate</groupId> </exclusion> <exclusion> <artifactId>slf4j-api</artifactId> <groupId>org.slf4j</groupId> </exclusion> </exclusions> </dependency> <dependency>
|