spring - JPA Detected reentrant flush -
I have very little problem with the OpenJapa implementation of JPA with Speed 2.5. My claim method:
@Transactional public user getUserByName (last string name) {return (get) user (getende) createEntityManager () createQuery ("U as user selector where u.name =: name ".) .setParameter (" name ", name) .getSingleResult (); }
org.springframework.dao.InvalidDataAccessApiUsageException returns:
org.apache.openjpa.persistence.InvalidStateException: Detected reentrant flush. Make sure that your flush-time instance callback management or event listeners do not call any operation, for which a complete flush is required to be completed. org.apache.openjpa.kernel.BrokerImpl.flushSafe (BrokerImpl.java:1904) on org.apache.openjpa.kernel.BrokerImpl.flush (BrokerImpl.java:1679) on org.apache.openjpa.kernel.QueryImpl.isInMemory on org.apache.openjpa.kernel.QueryImpl.execute (QueryImpl.java:779) on org.apache.openjpa.kernel.QueryImpl.execute (QueryImpl.java:838) (QueryImpl.java:956) on org.apache. openjpa.kernel.DelegatingQuery.execute (DelegatingQuery.java:525) org.apache.openjpa.persistence.QueryImpl.execute (QueryImpl.java:254) on org.apache.openjpa.persistence.QueryImpl.getSingleResult (on QueryImpl.java: 317) org.jpa.dao.UserDao.getUserByName (UserDao.java:71)
// On Edit EntityManager Settings:
& lt; Beam id = "EntityManagerFactory" class = "org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean" & gt; & Lt; Property Name = "Data Source" Riff = "Data Sources" / & gt; & Lt; Property Name = "JPAVENDER Adapter" & gt; & Lt; Bean square = "org.springframework.orm.jpa.vendor.OpenJpaVendorAdapter" & gt; & Lt; Property Name = "Show SQL" value = "False" /> & Lt; / Bean & gt; & Lt; / Property & gt; & Lt; Property Name = "Load Time Wave" & gt; & Lt; Bean square = "org.springframework.instrument.classloading.InstrumentationLoadTimeWeaver" /> & Lt; / Property & gt; & Lt; Property Name = "jpaDialect" & gt; & Lt; Bean square = "org.springframework.orm.jpa.vendor.OpenJpaDialect" /> & Lt; / Property & gt; & Lt; / Bean & gt; & Lt; Bean class = "org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
How do you get an entity management? In the Dao category:
@ParisCenceContact (type = persistence contact type.XATDED) Entity Manager unit manager protected;
What's wrong? Any ideas?
I have the same problem, and modify my unit for the primary key:
@ id / @ basic (optional = false) @ Generated Values (string = generation type.INNNTTIT)
Maybe you can help
Comments
Post a Comment