jake
unread,Nov 4, 2009, 1:16:32 PM11/4/09Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Castle Project Users
I created a view in mysql that join several tables. I then created an
ActiveRecord object to access the view like I would a table. The
issue is that whenever I compile I get the following error:
Can not modify more than one base table through a join view
'tablename'
It looks like nhibernate is doing an update, but I don't know why, I'm
only accessing the Find function of the object. Any Ideas?
Stack Trace:
[MySqlException (0x80004005): Can not modify more than one base table
through a join view 'tablename']
MySql.Data.MySqlClient.MySqlStream.OpenPacket() +278
MySql.Data.MySqlClient.NativeDriver.ReadResult(UInt64&
affectedRows, Int64& lastInsertId) +97
MySql.Data.MySqlClient.MySqlDataReader.GetResultSet() +87
MySql.Data.MySqlClient.MySqlDataReader.NextResult() +1004
MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior
behavior) +1620
MySql.Data.MySqlClient.MySqlCommand.ExecuteReader() +32
MySql.Data.MySqlClient.MySqlCommand.ExecuteNonQuery() +69
NHibernate.Impl.BatcherImpl.ExecuteNonQuery(IDbCommand cmd) +61
NHibernate.Impl.NonBatchingBatcher.AddToBatch(IExpectation
expectation) +66
NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object
id, Object[] fields, Object[] oldFields, Boolean[] includeProperty,
Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql,
ISessionImplementor session) +1906
[ADOException: could not update:
[Table.Models.Rooms.Community_Room_Client_View#15][SQL: UPDATE
viewname SET _id = ?, _id2 = ?, _id3 = ? WHERE _id4 = ?]]
NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object
id, Object[] fields, Object[] oldFields, Boolean[] includeProperty,
Int32 j, Object oldVersion, Object obj, SqlCommandInfo sql,
ISessionImplementor session) +2182
NHibernate.Persister.Entity.AbstractEntityPersister.Update(Object
id, Object[] fields, Int32[] dirtyFields, Boolean hasDirtyCollection,
Object[] oldFields, Object oldVersion, Object obj, ISessionImplementor
session) +512
NHibernate.Impl.ScheduledUpdate.Execute() +559
NHibernate.Impl.SessionImpl.Execute(IExecutable executable) +206
NHibernate.Impl.SessionImpl.ExecuteAll(IList list) +135
NHibernate.Impl.SessionImpl.Execute() +292
NHibernate.Impl.SessionImpl.Flush() +130
Castle.ActiveRecord.Framework.Scopes.AbstractScope.PerformDisposal
(ICollection`1 sessions, Boolean flush, Boolean close) +115
Castle.ActiveRecord.SessionScope.PerformDisposal(ICollection`1
sessions) +103
Castle.ActiveRecord.Framework.Scopes.AbstractScope.Dispose() +76
Castle.ActiveRecord.Framework.SessionScopeWebModule.OnEndRequest
(Object sender, EventArgs e) +126
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute
() +68
System.Web.HttpApplication.ExecuteStep(IExecutionStep step,
Boolean& completedSynchronously) +75