-->
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: Lost update
PostPosted: Wed Jun 02, 2010 4:56 am 
Newbie

Joined: Wed Jun 02, 2010 4:48 am
Posts: 1
Hello,

i've got a little problem with the latest NHibernate release.

Code:
[Transaction(ReadOnly=false)]
        public void DeleteReceiverWithReference(Guid receiverId)
        {
            IQuery q = Session.GetNamedQuery("GetShipmentReceiversByReceiver");
            q.SetGuid("value", receiverId);
            IList<ShipmentReceiver> myShipmentReceivers = q.List<ShipmentReceiver>();
            foreach (ShipmentReceiver mySReceiver in myShipmentReceivers)
            {
                mySReceiver.Receiver = null;
                mySReceiver.UsedAddress = null;
                mySReceiver.TaxNumber = "12345";
               
                Session.Update(mySReceiver);
            }
            bool t = Session.IsDirty();         
        }


After Session.update() the Session.IsDirty() returns false.
After the commit the update will not be flushed to the database.
The changes are lost! The Session should be dirty!?

Does anyone have any suggestions about what could be wrong?


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.