The use of explicit transactions is always recommended.

If you don't want to use transactions you must flush the session
(session.Flush()) in order to persist the changes.

On Tue, Mar 10, 2009 at 8:47 AM, 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to