-->
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: How to attach interceptor to HibernateContext?
PostPosted: Fri Apr 15, 2005 1:16 pm 
Newbie

Joined: Thu Jan 20, 2005 3:02 pm
Posts: 13
Hibernate version: 2.1.8

Name and version of the database you are using: My SQL 4.1

Jboss version: 4.0.1-sp1

Sorry in my previous post, I meant to say interceptor instead of listener

I need to know how to attach an interceptor to the session when using the HibernateContext API

How can I emulate something like:

Code:

Session sessionWithInterceptorAttached =
                 SessionFactory.openSession(myInterceptor)



Thanks again! :)


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 15, 2005 2:38 pm 
Newbie

Joined: Sat Apr 24, 2004 6:25 pm
Posts: 14
Location: Rochester, NY
In your hibernate-service.xml you can specify the intercepter as an attribute

<attribute name="SessionFactoryInterceptor">com.mycompany.MyInterceptor</attribute>

Ben


Top
 Profile  
 
 Post subject:
PostPosted: Fri Apr 15, 2005 5:11 pm 
Newbie

Joined: Thu Jan 20, 2005 3:02 pm
Posts: 13
Thanks!

I love it when its that easy! :)


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:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.