Hello all I am a very newbie of NH I am facing a problem about using
NH.
I have some class that have many-to-one mapping
However, I found that the internal implementation of NH.
It will have a Proxy class create at run-time and all object instance
will get by the Proxy class on demand.
However, if the Session is closed, the Proxy cannot request the object
instance and more.
Any idea to fix it???
I want to try to google it but i even don't know what keyword i need
in order to google the problem. OTL
Thank you very much
For Example
I have a Mapping Class:
<class name="Promotion">
<id name="promotionid">
<generator class="identity" />
</id>
<property name="enterpriseid" column="Enterprise"/>
<property name="promotionproduct" />
<property name="promotiondescription" />
<property name="promotionwebsite" />
<property name="clickthroughcount" />
<property name="promotionpublishdate" />
<many-to-one name="enterprise" column="Enterprise" />
</class>
and the Domain Class is:
public class Enterprise
{
public virtual long enterpriseid { get; set; }
public virtual string enterprisename { get; set; }
public virtual string loginname { get; set; }
public virtual string password { get; set; }
}
If I get a object of Promotion by calling a function getPromotionByID
(of course it will be more complicated in my function)
And then outside the getPromotionByID
when i use the object promotion.enterprise.Value;
but i use promotion.Value is OK because the value is not request from
NH on demand.
then exception will be thrown say no Session something.....
--
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.