Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic