-->
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: Interceptor.onFlushDirty not invoked when int[] is updated
PostPosted: Fri Oct 07, 2005 5:43 am 
Beginner
Beginner

Joined: Fri Oct 07, 2005 5:35 am
Posts: 38
Location: France
Hibernate version:3.1 rc1
Name and version of the database you are using:MySql

I have declared on custom interceptor on my Configuration. In a transaction I do :

Code:
manager.getTransaction().begin();
    Widget2 w = manager.find(Widget2.class, id);
    //w.setName("newName");
w.setArrays(new String[] { "toto", "titi", "uu","9" });
    w.setInts(new int[] { 0, 1, 2, 3,4,6,7,8,9 });
    manager.getTransaction().commit();


Top
 Profile  
 
 Post subject: re
PostPosted: Fri Oct 07, 2005 5:50 am 
Beginner
Beginner

Joined: Fri Oct 07, 2005 5:35 am
Posts: 38
Location: France
Sorry my post is imcomplete

Hibernate version:3.1 rc1
Name and version of the database you are using:MySql

I have declared on custom interceptor on my Configuration. In a transaction I do :
Code:
manager.getTransaction().begin();
    Widget2 w = manager.find(Widget2.class, id);
    //w.setName("newName");
w.setArrays(new String[] { "toto", "titi", "uu","9" });
    w.setInts(new int[] { 0, 1, 2, 3,4,6,7,8,9 });
    manager.getTransaction().commit();


In that case Inteceptor.onFlushDirty method is not invoked.

If I just uncommant setName line, interceptor.onFlushDirty is invoked.

Is it possible (and how) to be notify when an array is updated ?

I try to do the same with EJB3 annotations postUpdate and preUpdate I have the same problem :http://www.jboss.com/index.html?module=bb&op=viewtopic&t=70491


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 12:34 pm 
Beginner
Beginner

Joined: Fri Oct 07, 2005 5:35 am
Posts: 38
Location: France
Just some more comments.

My previous post is only true when entity is not versionned. Having a look to CollectionType:
Code:
public boolean isDirty(Object old, Object current, SessionImplementor session)
         throws HibernateException {
      // collections don't dirty an unversioned parent entity
      // TODO: I don't really like this implementation; it would be better if
      // this was handled by searchForDirtyCollections()
    return isOwnerVersioned( session ) && super.isDirty( old, current, session );
      // return false;

   }


If entity is not versionned isDirty is always false even if collection has been updated !


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