Hi,
I've defined persist method in GenericDAO as follows:
However, when I try to persist the entity a sequence gets generated as shown below but entity is not persisted to the database?Code:@Transactional(readOnly = false) public void persist(T entity) { entityManager.persist(entity); }
Any idea, why this is happening???
Code:DEBUG org.springframework.orm.jpa.SharedEntityManagerCreator$SharedEntityManagerInvocationHandler - Creating new EntityManager for shared EntityManager invocation DEBUG org.hibernate.impl.SessionImpl - opened session at timestamp: DEBUG org.hibernate.jdbc.AbstractBatcher - about to open PreparedStatement (open PreparedStatements: 0, globally: 0) DEBUG org.hibernate.jdbc.ConnectionManager - opening JDBC connection DEBUG org.hibernate.SQL - select PRODUCT_ID_SEQ.nextval from dual DEBUG org.hibernate.id.SequenceGenerator - Sequence identifier generated: BasicHolder[java.lang.Long[1004]] DEBUG org.hibernate.jdbc.AbstractBatcher - about to close PreparedStatement (open PreparedStatements: 1, globally: 1) DEBUG org.hibernate.jdbc.ConnectionManager - aggressively releasing JDBC connection DEBUG org.hibernate.jdbc.ConnectionManager - releasing JDBC connection [ (open PreparedStatements: 0, globally: 0) (open ResultSets: 0, globally: 0)] DEBUG org.hibernate.event.def.AbstractSaveEventListener - generated identifier: 50200, using strategy: org.hibernate.id.SequenceHiLoGenerator DEBUG org.springframework.orm.jpa.EntityManagerFactoryUtils - Closing JPA EntityManager


Reply With Quote
