]
Emmanuel Bernard commented on HSEARCH-460:
------------------------------------------
The test is fairly complex but one cause could be the misuse of merge
{code} em.merge(color);
em.remove(color);{code}
should really be
{code} em.remove(em.merge(color));
{code}
LazyInitializationException while removing entity with @ContainedIn
annotation
------------------------------------------------------------------------------
Key: HSEARCH-460
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-460
Project: Hibernate Search
Issue Type: Bug
Components: engine
Affects Versions: 3.1.1.GA
Reporter: Maciej Szulik
Priority: Blocker
Attachments: hibsearch.zip, Lazy.stack
I attach a Jboss Seam 2.2.0.GA project (without lib directory - one should take it
entirely from seam default application generated using seam gen), as a complete
illustration of the problem.
The Problem itself:
I have 2 entities:
Color (Long id, String name, Set<Vehicle> vehicles)
and Vehicle (Long id, String name, Color color).
Vehicle is indexed entity (@Indexed), while color has @ContainedIn on
Set<Vehicle>.
Problem arises while managing color objects, strictly speaking while removing colors,
LazyInitalizationException is thrown (stack trace is in attachment).
Every other operation on color entity (inserting, updating) works like a charm.
In attached example I created with a simple page for managing colors. It presents a list
of already defined color objects in DB. If non present, you should generate some with
'Add random color'. To obtain above error click on 'Remove' link next to
one of the colors presented on list.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: