well i think i found the answer by myself, nhibernate only persist entities when comit is called. Correct me if I'm wrong.....
On 10 mar, 11:47, graphicsxp <[email protected]> wrote: > Hello, > > I have a very strange problem but maybe it's just that I'm not so > experienced with nHibernate. > > I want to persist my entity so I call the .save() method like this : > > _session.Save(pCutting); > > but it is not saved and when using log4net i can see there;s no update > statement... > > Now if I use a transaction to save the same entity : > > ITransaction tx = null; > > try > { > tx = _session.BeginTransaction(); > _session.Save(pCutting); > tx.Commit(); > } > catch (Exception e) > { > tx.Rollback(); > throw e; > } > > That works, the update statement is generated on the Commit line. > > Why is that ? I don't want to use transactions all the time... --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
