Hello,
i'm using an post-update listener with hibernate 3.2.1 GA inside jboss. Have configured correctly persistence.xml and session binding to jndi.
Inside this listener i create a new audit-entry. Then i try to persist this transient object via following code:
Code:
private void saveNewObjectFromWithinEventListener( Object myObject ) {
try {
InitialContext ctx = new InitialContext();
SessionFactory factory = (SessionFactory) ctx.lookup("java:/hibernate/SessionFactory");
factory.getCurrentSession().save(myObject);
} catch (NamingException e) {
throw new HibernateException(e);
}
But the Audit entry get's never persisted in the database. No Exception is thrown. Is it impossible to create and persist objects inside an listener ?