javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: model.Subject

Searched on Google with the first line of a JAVA stack trace?

We can recommend more relevant solutions and speed up debugging when you paste your entire stack trace with the exception message. Try a sample exception.

Recommended solutions based on your search

Solutions on the web

via Stack Overflow by user3228763
, 2 years ago
org.hibernate.PersistentObjectException: detached entity passed to persist: model.Subject
via Stack Overflow by Depressio
, 2 years ago
org.hibernate.PersistentObjectException: detached entity passed to persist: com.depressio.SomeObject
via com.br by Unknown author, 1 year ago
org.hibernate.PersistentObjectException: detached entity passed to persist: erp.banco.Banco
via com.br by Unknown author, 2 years ago
org.hibernate.PersistentObjectException: detached entity passed to persist: br.com.persistencia.entidades.Produto
via com.br by Unknown author, 2 years ago
org.hibernate.PersistentObjectException: detached entity passed to persist: br.com.eboxbrasil.entity.User
via Stack Overflow by Jan
, 2 years ago
org.hibernate.PersistentObjectException: detached entity passed to persist: some.package.Entity
javax.persistence.PersistenceException: org.hibernate.PersistentObjectException: detached entity passed to persist: model.Subject
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:127)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)
at org.hibernate.tuple.entity.AbstractEntityTuplizer$IncrediblySillyJpaMapsIdMappedIdentifierValueMarshaller.getIdentifier(AbstractEntityTuplizer.java:375)
at org.hibernate.tuple.entity.AbstractEntityTuplizer.getIdentifier(AbstractEntityTuplizer.java:223)
at org.hibernate.persister.entity.AbstractEntityPersister.getIdentifier(AbstractEntityPersister.java:3850)
at org.hibernate.persister.entity.AbstractEntityPersister.isTransient(AbstractEntityPersister.java:3558)
at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:203)
at org.hibernate.event.def.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:531)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:102)
at org.hibernate.event.def.DefaultPersistEventListener.onPersist(DefaultPersistEventListener.java:61)
at org.hibernate.impl.SessionImpl.firePersist(SessionImpl.java:808)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:782)
at org.hibernate.impl.SessionImpl.persist(SessionImpl.java:786)
at org.hibernate.ejb.AbstractEntityManagerImpl.persist(AbstractEntityManagerImpl.java:672)
at undefined.Application.method3(Application.java:90)
at undefined.Application.main(Application.java:41)

Users with the same issue

Samebug visitor profile picture
Unknown user
2 times, 3 months ago
Samebug visitor profile picture
Unknown user
Once, 2 years ago

Write tip

Know the solutions? Share your knowledge to help other developers to debug faster.