Looking into this further, I have found that this property from the mapping
file appears to be the guilty party:
<property
name="IsNSF"
column="isNSF"
access="nosetter.pascalcase-m-underscore"
type="NHibernate.Nullables2.NullableBooleanType,
NHibernate.Nullables2" />
If I comment the property out, I don’t crash. In my (SQL Server) database,
this field is defined as a bit which allows nulls. On my class, the
property is read-only, defined as:
private bool? m_IsNSF;
public virtual bool IsNSF
{
get {
if (m_IsNSF == null) {
m_IsNSF = false;
}
return (bool)m_IsNSF;
}
}
This doesn’t look wrong to me, though. A little help to a newb?
Regards,
Remi.
From: [email protected] [mailto:[email protected]] On Behalf
Of Rémi Després-Smyth
Sent: April 27, 2009 2:10 PM
To: [email protected]
Subject: [nhusers] Crash in CastleProxyFactory.GetProxy
This may be much too vague, but…
NHibernate version 1.2.1.4000. I’m trying to load an entity using GetById.
CastleProxyFactory.GetProxy is crashing, no exception. Specifically, in
this method:
public INHibernateProxy GetProxy(object id, ISessionImplementor
session)
{
try
{
CastleLazyInitializer initializer = new
CastleLazyInitializer(_persistentClass, id,
_getIdentifierMethod, _setIdentifierMethod, session);
object generatedProxy = null;
if (IsClassProxy)
{
generatedProxy =
_proxyGenerator.CreateClassProxy(_persistentClass, _interfaces, initializer,
false);
}
else
{
generatedProxy =
_proxyGenerator.CreateProxy(_interfaces, initializer, new object());
}
initializer._constructed = true;
return (INHibernateProxy) generatedProxy;
}
catch (Exception e)
{
log.Error("Creating a proxy instance failed", e);
throw new HibernateException("Creating a proxy
instance failed", e);
}
}
CreateClassProxy appears to be executed and generatedProxy gets assigned
fine. But when initializer._constructed gets assigned to true, the process
crashes. If the origin of the call is from a web page, it just dies; if I’m
running a test in the NUnit runner: “NUnit has encountered a problem and
needs to close”; if I trace through the code in VS: “An existing connection
was forcibly closed by the remote host”.
Can anyone point me in the right direction, or suggest avenues to
investigate?
Thanks.
Remi.
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---