[
http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-460?pag...
]
Maciej Szulik commented on HSEARCH-460:
---------------------------------------
I'm 1000% sure that this is session management issue and that indexing should occur
inside the session. But I'm not managing the session by myself - application container
is responsible for that (In my case it's JBoss).
Also I cannot isolate the problem, because of the need for application container. Of
course you can throw all the JBoss Seam specific code and leave pure EJB's and the
problem will remain, because the session is managed by container not me! If I'm wrong
feel free to correct my way of thinking.
The problem didn't exist for me in previous versions (namely 3.0.1.GA), because the
mechanism didn't work at all, I had to manually invoke reindex, and then I always
retrieved the session if one wasn't available. Now I can't even override the
default behavior without downgrading.
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:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira