Mantis - Resin
Viewing Issue Advanced Details
3559 minor always 06-15-09 22:10 06-18-09 11:38
ferg  
ferg  
normal  
closed  
fixed  
none    
none 4.0.1  
0003559: callBeforeCompletion registration
(rep by Peter Pastrnak )

I'm not sure, if this is a hibernate search problem or a resin server related problem (or my code).

But currently it seems, that hibernate search registers a new synchronization during "callBeforeCompletion" and it expects, that this synchronization's "callBeforeCompletion" will be called during the same commit. At least my version of Resin does not allow this. It does call the "callAfterCompletion", but not the "callBeforeCompletion". The reason is, that Resin uses an ArrayList to store the synchronizations and as it is already traversing the list, it does not call the newly added synchronization. Here is the code of TransactionImpl, where length is a constant, so it does not reflect changes to the _syncList:

private void callBeforeCompletion()
throws RollbackException
{
int length = _syncList == null ? 0 : _syncList.size();

for (int i = 0; i < length; i++) {
Synchronization sync = _syncList.get(i);

try {
sync.beforeCompletion();
} catch (RuntimeException e) {
throw new RollbackException(e);
} catch (Throwable e) {
log.log(Level.FINE, e.toString(), e);
}
}

Is it problem of hibernate search or Resin server? I'm not sure what the specs say...

This is the stack trace:

TransactionImpl.registerSynchronization(Synchronization) line: 513
JTATransaction.registerSynchronization(Synchronization) line: 313
EventSourceTransactionContext.registerSynchronization(Synchronization) line: 56
TransactionalWorker.performWork(Work, TransactionContext) line: 47
FullTextIndexEventListener.processWork(T, Serializable, WorkType, AbstractEvent) line: 128
FullTextIndexEventListener.onPostUpdate(PostUpdateEvent) line: 120
EntityUpdateAction.postUpdate() line: 200
EntityUpdateAction.execute() line: 179
ActionQueue.execute(Executable) line: 279
ActionQueue.executeActions(List) line: 263
ActionQueue.executeActions() line: 168
DefaultFlushEventListener(AbstractFlushingEventListener).performExecutions(EventSource) line: 321
DefaultFlushEventListener.onFlush(FlushEvent) line: 50
SessionImpl.flush() line: 1027
SessionImpl.managedFlush() line: 365
CacheSynchronization.beforeCompletion() line: 88
TransactionImpl.callBeforeCompletion() line: 832
TransactionImpl.commit() line: 564
TransactionManagerImpl.commit() line: 261
UserTransactionImpl.commit() line: 407
UserTransactionProxy.commit() line: 138
JTASupport.commit() line: 73

Notes
(0004079)
ferg   
06-18-09 11:38   
server/16h2