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?
|
|