Hello,
I rerun the video about Nhibernate from Steve Bohlen.
My configuration : Vista x64 SP1 - Visual Studio 2008 SP1 - SQLServer
2008 with AdventureWorksDatabase/
I created a BO project, with a class and the mapping file
A DAL project to access database with Nhibernate
I created a test project.
When I try to run the test, I have this error (see below). I check all
and all look good .... for me.
Thanks,
NHibernate: SELECT customer0_.CustomerID as CustomerID0_0_,
customer0_.FirstName as FirstName0_0_, customer0_.LastName as
LastName0_0_ FROM Customer customer0_ WHERE [EMAIL PROTECTED];
@p0 = '1'
TestCase 'M:DAL_Test.Tests.CanGestCustomerById'
failed: could not load an entity: [BO.Customer#1][SQL: SELECT
customer0_.CustomerID as CustomerID0_0_, customer0_.FirstName as
FirstName0_0_, customer0_.LastName as LastName0_0_ FROM Customer
customer0_ WHERE customer0_.CustomerID=?]
NHibernate.Exceptions.GenericADOException: could not load an entity:
[BO.Customer#1][SQL: SELECT customer0_.CustomerID as CustomerID0_0_,
customer0_.FirstName as FirstName0_0_, customer0_.LastName as
LastName0_0_ FROM Customer customer0_ WHERE customer0_.CustomerID=?]
---> System.Data.SqlClient.SqlException: Invalid object name
'Customer'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException
exception, Boolean breakConnection)
at
System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject
stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior,
SqlCommand cmdHandler, SqlDataReader dataStream,
BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject
stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader
ds, RunBehavior runBehavior, String resetOptionsString)
at
System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean
async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior
cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String
method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior
behavior, String method)
at
System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior
behavior)
at
System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader()
at NHibernate.AdoNet.AbstractBatcher.ExecuteReader(IDbCommand cmd)
at NHibernate.Loader.Loader.GetResultSet(IDbCommand st, Boolean
autoDiscoverTypes, Boolean callable, RowSelection selection,
ISessionImplementor session)
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session,
QueryParameters queryParameters, Boolean returnProxies)
at
NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor
session, QueryParameters queryParameters, Boolean returnProxies)
at NHibernate.Loader.Loader.LoadEntity(ISessionImplementor session,
Object id, IType identifierType, Object optionalObject, String
optionalEntityName, Object optionalIdentifier, IEntityPersister
persister)
--- End of inner exception stack trace ---
at NHibernate.Loader.Loader.LoadEntity(ISessionImplementor session,
Object id, IType identifierType, Object optionalObject, String
optionalEntityName, Object optionalIdentifier, IEntityPersister
persister)
at
NHibernate.Loader.Entity.AbstractEntityLoader.Load(ISessionImplementor
session, Object id, Object optionalObject, Object optionalId)
at NHibernate.Loader.Entity.AbstractEntityLoader.Load(Object id,
Object optionalObject, ISessionImplementor session)
at NHibernate.Persister.Entity.AbstractEntityPersister.Load(Object
id, Object optionalObject, LockMode lockMode, ISessionImplementor
session)
at
NHibernate.Event.Default.DefaultLoadEventListener.LoadFromDatasource(LoadEvent
event, IEntityPersister persister, EntityKey keyToLoad, LoadType
options)
at NHibernate.Event.Default.DefaultLoadEventListener.DoLoad(LoadEvent
event, IEntityPersister persister, EntityKey keyToLoad, LoadType
options)
at NHibernate.Event.Default.DefaultLoadEventListener.Load(LoadEvent
event, IEntityPersister persister, EntityKey keyToLoad, LoadType
options)
at
NHibernate.Event.Default.DefaultLoadEventListener.ProxyOrLoad(LoadEvent
event, IEntityPersister persister, EntityKey keyToLoad, LoadType
options)
at NHibernate.Event.Default.DefaultLoadEventListener.OnLoad(LoadEvent
event, LoadType loadType)
at NHibernate.Impl.SessionImpl.FireLoad(LoadEvent event, LoadType
loadType)
at NHibernate.Impl.SessionImpl.Get(String entityName, Object id)
at NHibernate.Impl.SessionImpl.Get(Type entityClass, Object id)
at NHibernate.Impl.SessionImpl.Get[T](Object id)
C:\Users\Chris\Documents\Visual Studio 2008\Projects\NH\DAL
\NHibernateDataProvider.cs(18,0): at
DAL.NHibernateDataProvider.GetCustomerById(Int32 customerId)
C:\Users\Chris\Documents\Visual Studio 2008\Projects\NH\DAL_Test
\Tests.cs(18,0): at DAL_Test.Tests.CanGestCustomerById()
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---