-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: AuditLogInterceptor / Session.connection() deprecated
PostPosted: Tue Sep 18, 2007 10:42 am 
Newbie

Joined: Tue Aug 28, 2007 12:54 pm
Posts: 16
Location: Munich, Germany
Hello all,

Java Persistence with Hibernate page 549 and other online ressources
give an Interceptor "reference implementation" (AuditLogInterceptor)
that writes an audit log about entity changes to a different table.

This is done in a new Session opened via Session.connection() since
an Interceptor callback method is not allowed to write to the same session.

However, with (at least) Hibernate 3.2.4.sp1 the Session.connection()
call is deprecated
.

The deprecation comment "to be replaced with a SPI for performing
work against the connection; scheduled for removal in 4.x" doesn't
tell me too much, really...

What would be the recommended way now ?

(Christian, shouldn't this also be mentioned in the book errata ? )

Thanks & Cheers, Tom.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 08, 2007 7:26 am 
Newbie

Joined: Tue Aug 28, 2007 12:54 pm
Posts: 16
Location: Munich, Germany
bump - is this not a valid question ?

_________________
www.tomeicher.de


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 09, 2007 4:25 am 
Newbie

Joined: Thu May 06, 2004 10:10 am
Posts: 14
cheesus wrote:
bump - is this not a valid question ?


I think it is a valid question :) I bumped into the same thing and then found your posting. Apparently this way of doing things is to be replaced with something else. The funny thing is, the current online API docs don't really say anything about it:

http://www.hibernate.org/hib_docs/v3/api/org/hibernate/Session.html#connection()

All is explained over here though:
http://forum.hibernate.org/viewtopic.php?t=974518&highlight=session+connection+deprecated


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.