-->
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.  [ 1 post ] 
Author Message
 Post subject: Event Handler Problem in hibernate3.1
PostPosted: Sat Jan 07, 2006 3:13 am 
Newbie

Joined: Sat Nov 12, 2005 1:12 am
Posts: 4
Location: Islamabad, Pakistan
I am using Hibenrate 3.1, in HibernateUtil.java i have the following code in static intializer, HibernateUtil is used for session related work.

static {
try {
// Create the SessionFactory
Configuration configuration = new Configuration();
sessionFactory = configuration.configure().buildSessionFactory();
LoadEventListener[] stack = { new AuditLogEventHandler(), new DefaultLoadEventListener() };
configuration.getEventListeners().setLoadEventListeners(stack);

} catch (Throwable ex) {
ex.printStackTrace();
throw new ExceptionInInitializerError(ex);
}
}


AuditLogEvent is as

public class AuditLogEventHandler implements LoadEventListener{

public AuditLogEventHandler(){
System.out.println("************************************************Audit log event handler called");
}

public void onLoad(LoadEvent event, LoadEventListener.LoadType loadType) throws HibernateException {
System.out.println("***************************************Load event called");
}
}

The constructor for AuditLogEventHandler is called but the onLoad event handler is not called. Can u plz identify why?


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

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.