Win a copy of Modern JavaScript for the Impatient this week in the Server-Side JavaScript and NodeJS forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

PersistentObjectException: detached entity passed to persist:

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

using spring 3.03 and hibernate 3.3.2.GA with postgresql 8.4.x along with Hibernate Commons Annotations 3.1.0.GA.

I have a functional test which tests the persistence layer which is giving me
org.hibernate.PersistentObjectException: detached entity passed to persist: com.vattikutiirf.nucleus.domain.generated.CboImpl.

I have @Transactional for this class, PersistenceLayerImpl and all the DAOImpl classes; I have set show_sql to true and loglevel to trace.
I see that my various DAO classes are getting different Session Objects even though I have passed the same SessionFactory to all of them.

How do I fix this ?
How do I force the same Transaction/Session to be used so that CboImpl does NOT get detached by the time I set it to Family for persistence ?

Thanks for any clues,

BR,
~A







applicationContext.xml


 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
    Bookmark Topic Watch Topic
  • New Topic