• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

PersistentObjectException: detached entity passed to persist:

 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
reply
    Bookmark Topic Watch Topic
  • New Topic