Use of ISession in IPostXXX Listeners

2 views
Skip to first unread message

scarpen

unread,
Jun 13, 2008, 9:43:58 AM6/13/08
to nhusers
I'm working on an auditing listener that uses the PostInsert/Update/
Delete events to do its auditing. The audit data is saved to a
separate auditing table (not in the audited entity's table). Is it
safe to use the ISession instance that's available as part of the
event args to do this save or do I need to open a new session? I know
the Hibernate docs mention using a new session with interceptors but
I'm not sure if this applies to PostXXX listeners as well.

Thanks,
Sean Carpenter

Dario Quintana

unread,
Jun 13, 2008, 1:56:42 PM6/13/08
to nhu...@googlegroups.com
Hi Sean, yes it is. EventListerners is an evolution of Interceptors.

Best regards
--
Dario Quintana
http://darioquintana.com.ar

scarpen

unread,
Jun 16, 2008, 8:55:58 AM6/16/08
to nhusers
Dario -
Thanks for the info. After I re-read this, I realized that I asked
two questions in my original post and then I started to doubt my
interpretation of your answer. I hope you're saying that "yes, it's
safe to use the ISession instance available in the event args".

Thanks again,
Sean Carpenter

On Jun 13, 1:56 pm, "Dario Quintana" <conta...@darioquintana.com.ar>
wrote:

Dario Quintana

unread,
Jun 16, 2008, 2:57:40 PM6/16/08
to nhu...@googlegroups.com
Exactly


On Mon, Jun 16, 2008 at 9:55 AM, scarpen <stcar...@gmail.com> wrote:
"yes, it's safe to use the ISession instance available in the event args".


Reply all
Reply to author
Forward
0 new messages