jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Marcel Reutegger <marcel.reuteg...@gmx.net>
Subject Re: Synchronous event listener
Date Wed, 14 May 2008 07:50:17 GMT
Roman Puchkovskiy wrote:
> Jackrabbit contains interface SynchronousEventListener. Looks like, if you
> register listener implementing this interface through
> ObservationManager.addEventListener(), it will be notified of events before
> changes are persisted, not after.

no, this is not quite correct. synchronous event listeners are notified using 
the same thread that commits changes, but only after they have been committed.

jackrabbit guarantees that a synchronous event listener sees items exactly as 
they appear after the transaction has been committed. please note that this 
guarantee only applies to item that were modified by the transaction.

> Is it OK to use this interface? Or is it 'very internal' and used only for
> Jackrabbit implementation?

it is OK to use it but only if you know exactly what you are doing ;)

why do you need a synchronous event listener?

> If we use a transaction (possibly XA transaction), will such listener be
> notified of changes just after transaction was committed, or is there chance
> that transaction rolls back after listener was notified?

no, that's not possible. event listeners (synchronous as well as asynchronous) 
are only notified about changes that were successfully committed.

regards
  marcel

Mime
View raw message