Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] Listenening to Session/ UnitofWork Events from jpa/j2ee

The best way to configure a SessionEventListener, is in a SessionCustomizer by using EclipseLink specific code.

-Tom

On 20/10/2011 9:24 AM, Tim Martin wrote:
Before I go down a certain track to far I just wanted to check if from within
jpa using eclipselink 2.3 it's possible to register a session/ unit of work
listener to these events here
http://wiki.eclipse.org/Introduction_to_EclipseLink_Sessions_(ELUG)#Table_83-3
and act on them once a transaction has commited/ rolled back.

we need to hold some info that is accumulated during a transaction and then only
if the transaction commits send it on to some other part of the application for
processing. we have looked at writing the info to db tables and reading after
the transaction commits or sending to jms where it would get removed if the
transaction rollsback, but neither of those really meet our requirements.

I cant find any readily available info on how to register a uow/ session
listener from within jee. I found this here
http://wiki.eclipse.org/Configuring_a_Session_%28ELUG%29#Configuring_Session_Event_Listeners
but how would I get hold of the session from within jpa where i just have the
SessionContext or EntityManager ? Do I need to use a SessionCustomizer ?

we can use eclipselink specific code if needed...

Thanks


_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users


Back to the top