Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Transaction listeners? <possibly OT>

The JPA specification does not offer a solution to this, but EclipseLink has
extended support for SessionEvents and UnitOfWorkChangeSets.

Refer to the SessionEventListener and SessionEventManager, which can be
configured using a SessionCustomizer in your persistence.xml,
http://www.eclipse.org/eclipselink/api/1.2/org/eclipse/persistence/sessions/SessionEventListener.html

http://www.eclipse.org/eclipselink/api/1.2/org/eclipse/persistence/sessions/UnitOfWork.html#getUnitOfWorkChangeSet()

http://www.eclipse.org/eclipselink/api/1.2/org/eclipse/persistence/sessions/changesets/UnitOfWorkChangeSet.html


Syvalta wrote:
> 
> Hi,
> 
> Is there any way to know what has changed in a transaction, something like
> a transaction listener? Something in lines of "transaction committed,
> entity x updated, entity y removed, entity z persisted". If I understood
> JPA specification correctly, entity listeners are called independent of
> the transaction, so if commit fails entity listeners for some of the
> entities might already got called.
> 
> Some use cases I have in mind: change log of the system configuration,
> applying configuration changes to a running system (think for example of
> mail server which can be configured from web ui).
> 
> Any ideas/comments/pointers really appreciated.
> 
> 


-----
http://wiki.eclipse.org/User:James.sutherland.oracle.com James Sutherland 
http://www.eclipse.org/eclipselink/
 EclipseLink ,  http://www.oracle.com/technology/products/ias/toplink/
TopLink 
Wiki:  http://wiki.eclipse.org/EclipseLink EclipseLink , 
http://wiki.oracle.com/page/TopLink TopLink 
Forums:  http://forums.oracle.com/forums/forum.jspa?forumID=48 TopLink , 
http://www.nabble.com/EclipseLink-f26430.html EclipseLink 
Book:  http://en.wikibooks.org/wiki/Java_Persistence Java Persistence 
-- 
View this message in context: http://old.nabble.com/Transaction-listeners--%3Cpossibly-OT%3E-tp26114366p26160171.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top