I'm know this is a very basic question and for that I applogize but I
am missing something fundamental here. I am using an open session in
view model, and I close the session in the EndRequest event of an
httpmodule.
I just noticed that when I called SaveOrUpdate on my root object that
is was not actually saved to the DB until I closed the session. I
would like for the object to be persisted when I call into nHibernate
allowing me to handle failures gracefuly.
I am using the following snippet to map this object:
<class name="xxx.Organization" table="Organization" lazy="false">
<id name="Id" column="OrganizationId">
<generator class="guid" />
</id>
<property name="Name" column="Name" type="String" length="50"/>
.... other properties removed, I do have Components, an IdBag and a
Set in addition to regular properties.
</class>
I guess my workaround is to force a flush after I call SaveOrUpdate
but what is the recommended practice? Am I missing something else?
Thanks guys,
Josh
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---