• 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
  • Devaka Cooray
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Jeanne Boyarsky
  • Tim Cooke
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Mikalai Zaikin
  • Carey Brown
Bartenders:

(JPA) Correct way to remove entity ?

 
Ranch Hand
Posts: 98
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi!

In a project a bug appeared after some "unrelated" changes and we had to add a line of code to fix it.

Old code:


New code:


Mappings:


The change that I suspect triggered the problem is that change from FetchType.LAZY to FetchType.EAGER in Bar.java.
We got this exception after removeFoo() returns:



This is run under JBoss 4.2.3.GA on Windows XP Pro SP3 with Sun Java 1.6.0u20


So the question is:
Is this the correct way to remove entities? That is manually removing references to it from other entities?
Sound like a lot of "unneeded" work.

Regards,
David
 
I can't take it! You are too smart for me! Here is the tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic