wrong interpretation.
Load throw an exception if the "record" doe not exist but only when you try
to access to a property of the loaded instance.
Load will never return null because Load return a proxy.

2010/2/19 Tomasz Modelski (IDev) <[email protected]>

> Hi.
>
> As I understand, Session.Load<TEntity>(id) should return proper entity
> or throw exception if entity with such id doesn't exist.
> Is it true ?
>
> Right now I'm debugging code when Session.Load<TEntity>( 0 ) returns
> not-null and doesn't throw exception, and there is not TEntity with id
> 0 in database.
> Returned object is some TEntity proxy with properties throwing
> exceptions when accessed.
>
> I'm using NHibernate v. 2.1.2.4000.
>
> --
> 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]<nhusers%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/nhusers?hl=en.
>
>


-- 
Fabio Maulo

-- 
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