Lock yes and then Updatebut SaveOrUpdateCopy, and then you should use the entity returned by SaveOrUpdateCopy, is doing both work. Take a look to this test<https://nhibernate.svn.sourceforge.net/svnroot/nhibernate/trunk/nhibernate/src/NHibernate.Test/Events/PostEvents/PostUpdateFixture.cs> .
2009/6/1 Arman <[email protected]> > > excuse me Fabio for asking to much questions, > > but what the Lock() and Refresh() methods do ? do they help us in this > way ?? > > > On Jun 1, 11:14 pm, Fabio Maulo <[email protected]> wrote: > > SaveOrUpdateCopy > > > > 2009/6/1 Arman <[email protected]> > > > > > > > > > > > > > it was not me who wrote that post on JIRA , somebody else pointed to > > > my topic in here , > > > > > thankU for your reply, > > > because this project is an old one , it uses NHibernate version > > > 1.0.0 , the session object have the Evict method but i couldn't find > > > Merge method in that , do it have any equivalence method in this > > > version ? > > > > > and another question , Merge method should be before the change of > > > properties or before the Update in DB ? > > > > > tnx > > > > > On Jun 1, 10:23 pm, Fabio Maulo <[email protected]> wrote: > > > > This is a new practice... write a request here and before have an > > > answerer > > > > create a new JIRA.http://nhjira.koah.net/browse/NH-1807 > > > > > > The answer is on JIRA; next time, please, avoid this behavior and in > > > general > > > > avoid to put links to forum threads in JIRA. > > > > Thanks. > > > > > > 2009/6/1 Fabio Maulo <[email protected]> > > > > > > > 2009/6/1 Arman <[email protected]> > > > > > > >> in fact , i have a GETALLSTUDENT method that open a session , get > all > > > > >> students , and the close the session, > > > > >> then when user hit the OK button , i open a new session , and > update > > > > >> the updated student in that , and close it again. > > > > > > >> do you mean that i should not close the session in querying ? > > > > > > > No, I mean that you can't have the old state in a fresh session. > You > > > should > > > > > use session.Merge to reattach and update or something else to get > the > > > > > previous state (note this ever mean hit a SELECT before update). > > > > > -- > > > > > Fabio Maulo > > > > > > -- > > > > Fabio Maulo > > > > -- > > Fabio Maulo > > > -- Fabio Maulo --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nhusers?hl=en -~----------~----~----~----~------~----~------~--~---
