Hello,

if i try to persist a newly created object inside an hibernate3-listener, this 
object get never persisted in the database. Using following code-snippet for 
persisting:

  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);
  |         }

Especially i using an post-update-listener of Hibernate3 inside jboss 4.0.5. 
The listener is registered in the persistence.xml and if i debug, i see that 
the listener is invoked. All runs fine, i'm getting no exception, but only the 
transient object will not be persisted to the database.

Is it  impossible to persist a new (transient) object created inside an 
hibernate-listener to the database within these listener ?

[Using jboss 4.0.5 EJB3 RC9]

View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3995068#3995068

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3995068
_______________________________________________
jboss-user mailing list
[email protected]
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to