[Hibernate-JIRA] Created: (HSEARCH-399) NPE in org.hibernate.search.backend.WorkQueue.clear()
by Dobes Vandermeer (JIRA)
NPE in org.hibernate.search.backend.WorkQueue.clear()
-----------------------------------------------------
Key: HSEARCH-399
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-399
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.1.1.GA
Reporter: Dobes Vandermeer
Our server blew up, and we're seeing a continuous stream of:
[#|2009-09-17T06:24:02.169-0700|SEVERE|sun-appserver9.1|books.db.search.SafeBatchedQueueingProcessor|_ThreadID=40;_Threa
dName=httpSSLWorkerThread-8080-19;_RequestID=97e3df6c-2fc7-4f54-a47a-e77ba48d1a07;|RuntimeException during cancelWorks()
java.lang.NullPointerException
at org.hibernate.search.backend.WorkQueue.clear(WorkQueue.java:58)
at org.hibernate.search.backend.impl.BatchedQueueingProcessor.cancelWorks(BatchedQueueingProcessor.java:180)
at org.hibernate.search.backend.impl.PostTransactionWorkQueueSynchronization.afterCompletion(PostTransactionWorkQueueSynchronization.java:56)
at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:491)
The method body for this is:
public void clear() {
queue.clear(); // <---- queue is null
if (sealedQueue != null) sealedQueue.clear();
}
It appears that queue may be set null by the setSealedQueue method above:
public void setSealedQueue(List<LuceneWork> sealedQueue) {
//invalidate the working queue for serializability
queue = null;
this.sealedQueue = sealedQueue;
}
The only change I've made recently that I thought could cause this was to change the search system to run in a separate thread. My hibernate search options are:
<exclude-unlisted-classes>true</exclude-unlisted-classes>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.show_sql" value="false"/>
<property name="hibernate.cache.provider_class" value="net.sf.ehcache.hibernate.EhCacheProvider"/>
<property name="hibernate.cache.use_query_cache" value="true"/>
<property name="hibernate.cache.use_second_level_cache" value="true"/>
<property name="hibernate.bytecode.provider" value="javassist"/>
<property name="hibernate.search.default.directory_provider" value="org.hibernate.search.store.FSDirectoryProvider"/>
<property name="hibernate.search.default.indexBase" value="../search-indexes"/>
<property name="hibernate.search.worker.scope" value="books.db.search.SafeWorkerImpl"/>
<property name="hibernate.search.worker.backend" value="books.db.search.SafeBackendQueueProcessorFactory"/>
<property name="hibernate.search.worker.execution" value="async"/> <!-- sync or async -->
<property name="hibernate.search.worker.buffer_queue.max" value="5"/>
<property name="hibernate.search.worker.thread_pool.size" value="5"/>
</properties>
Note that books.db.search.Safe* are classes I wrote that wrap the default implementation with an exception handler; sometimes RuntimeExceptions were thrown and glassfish would just silently eat them and fail, now they are noisily eaten and the transaction commits anyway.
This was probably (to some degree) triggered by the exception logged just prior:
[#|2009-09-17T06:23:56.498-0700|SEVERE|sun-appserver9.1|org.hibernate.event.def.AbstractFlushingEventListener|_ThreadID=40;_ThreadName=httpSSLWorkerThread-8080-19;_RequestID=97e3df6c-2fc7-4f54-a47a-e77ba48d1a07;|Could not synchronize database state with session
org.hibernate.StaleObjectStateException: Row was updated or deleted by another transaction (or unsaved-value mapping was incorrect): [books.db.Business#5617057]
at org.hibernate.persister.entity.AbstractEntityPersister.check(AbstractEntityPersister.java:1782)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2425)
at org.hibernate.persister.entity.AbstractEntityPersister.updateOrInsert(AbstractEntityPersister.java:2325)
at org.hibernate.persister.entity.AbstractEntityPersister.update(AbstractEntityPersister.java:2625)
at org.hibernate.action.EntityUpdateAction.execute(EntityUpdateAction.java:115)
at org.hibernate.engine.ActionQueue.execute(ActionQueue.java:279)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:263)
at org.hibernate.engine.ActionQueue.executeActions(ActionQueue.java:168)
at org.hibernate.event.def.AbstractFlushingEventListener.performExecutions(AbstractFlushingEventListener.java:321)
at org.hibernate.event.def.DefaultFlushEventListener.onFlush(DefaultFlushEventListener.java:50)
at org.hibernate.impl.SessionImpl.flush(SessionImpl.java:1028)
at org.hibernate.impl.SessionImpl.managedFlush(SessionImpl.java:366)
at org.hibernate.ejb.AbstractEntityManagerImpl$1.beforeCompletion(AbstractEntityManagerImpl.java:504)
at com.sun.enterprise.distributedtx.J2EETransaction.commit(J2EETransaction.java:419)
Figuring out under which conditions the queue became null but shouldn't have been might be nearly impossible at this point, although I'll watch out for repeats of this issue.
The NPE itself might be easier to fix, if you just check for null before calling clear().
For now I'll try implementing a workaround in my safe subclass like this:
@Override
public void cancelWorks(WorkQueue workQueue) {
try {
super.cancelWorks(workQueue);
} catch (RuntimeException e) {
logger.error("RuntimeException during cancelWorks()", e);
try {
if(workQueue.getQueue() != null)
workQueue.getQueue().clear();
else
workQueue.getSealedQueue().clear();
} catch(org.hibernate.annotations.common.AssertionFailure t) {
// sealedQueue was null too
}
}
}
--
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
14 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-462) Indexes are not getting updated when entity gets updated via hql.
by shareef shaik (JIRA)
Indexes are not getting updated when entity gets updated via hql.
-----------------------------------------------------------------
Key: HSEARCH-462
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-462
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.1.1.GA
Environment: Hibernate 3.3, H-Search 3.1.1 GA, Hiberante Annotations, Oracle DB, FSDirectoryProvider
Reporter: shareef shaik
We are using Hibernate Annotations and Hibernate Search, and to my understanding there is no need to write listeners to update/delete index on update/delete of an entity. I tried updating an entity via hql update, and also via persisting the entity and making changes in it. In the second scenario, the index is getting updated, but in the first scenario it is not. I checked for the changes in db and in both scenarios, the changes are reflected in db. A simple test case for the same.
Case 1:
--------
String hql = "update UserMaster umst set umst.userName = :uName where umst.userId = :uId";
org.hibernate.Query query = getSession().createQuery(hql);
query.setParameter("uName","ABM1");
query.setParameter("uId",1001L);
query.executeUpdate();
Case 2:
--------
UserMaster master = (UserMaster)getSession().get(UserMaster.class,1001L);
master.setUserName("ABM1");
--
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
14 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-466) separating annotations from core as own jar
by Vadim Bauer (JIRA)
separating annotations from core as own jar
-------------------------------------------
Key: HSEARCH-466
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-466
Project: Hibernate Search
Issue Type: Improvement
Components: build
Affects Versions: 3.2.0.Beta1, 3.1.1.GA, 3.1.0.GA, 3.1.0.CR1, 3.1.0.Beta2, 3.1.0.Beta1, 3.1.2, 3.2.0.CR1, 3.3.0
Environment: not important
Reporter: Vadim Bauer
Why not separating the hibernate search annotations from HS core?
e.g.
hibernate-search-core.jar
hibernate-search-annotations.jar
It is quite cumbersome if you in a fat clients or RCPs environment and want share the same domain model with your client. The client needs to have lucene, hibernate search and hibernate stuff even thou he never uses it except a few annotations.
If it is ok I would like contribute my changes to the community.
Best regards
Vadim
--
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
14 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-460) LazyInitializationException while removing entity with @ContainedIn annotation
by Maciej Szulik (JIRA)
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
14 years, 3 months
[Hibernate-JIRA] Created: (HSEARCH-385) Lazy ManyToOne association with @containedIn annotation cause HSearch create entity index with documentId = 0
by Grégoire Rolland (JIRA)
Lazy ManyToOne association with @containedIn annotation cause HSearch create entity index with documentId = 0
-------------------------------------------------------------------------------------------------------------
Key: HSEARCH-385
URL: http://opensource.atlassian.com/projects/hibernate/browse/HSEARCH-385
Project: Hibernate Search
Issue Type: Bug
Affects Versions: 3.1.1.GA, 3.1.0.GA
Environment: Hibernate 3.3.1.GA, Postgresql 8.3
Reporter: Grégoire Rolland
Priority: Critical
Attachments: hsearch.tar.gz
In a transaction, create Entity1 associated to one Entity2 (E1->E2 lazy oneToMany, E2->E1 lazy manyToOne).
In antoher transaction, find Entity2, modify Entity2.
On commit, I get this log :
2009-07-02 11:42:18,791 TRACE [org.hibernate.search.backend.impl.lucene.works.DeleteExtWorkDelegate] - Removing class org.foo.hibernate.search.jira.Entity1#0 by id using an IndexWriter.
2009-07-02 11:42:18,792 TRACE [org.hibernate.search.backend.impl.lucene.works.AddWorkDelegate] - add to Lucene index: class org.foo.hibernate.search.jira.Entity1#0:Document<stored/uncompressed,indexed<_hibernate_class:org.foo.hibernate.search.jira.Entity1> stored/uncompressed,indexed<uid:0> stored/uncompressed,indexed<entities2.uid:224136060>>
in the index :
1 document for Entity, with the correct Id, and 1 document with Id = 0, index is corrupted.
See the test case for more info.
--
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
14 years, 3 months