• Post Reply Bookmark Topic Watch Topic
  • New Topic

(JPA) Correct way to remove entity ?

 
David Balažic
Ranch Hand
Posts: 96
  • Mark post as helpful
  • send pies
  • 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
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!