scottl2001
unread,Jun 24, 2011, 10:17:47 AM6/24/11Sign 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've got a situation I've encountered before, and am still trying to
resolve:
When I'm trying to add a record to the database with castle, it will
no longer allow me to do so, (stack trace provided below)
In the past, I've alleviated the problem by doing an
ActiveRecordStarter.CreateSchema(); after initializing the classes,
but was never able to do this without losing all of the data.
I'm no longer in a position where I can lose the data when re creating
the schema. Is there a way to re crate the schema without losing all
of the data? Using NHibernate and MS SQL Server
***********************************
Message:
Could not perform Create for Run
Exception Trace:
at Castle.ActiveRecord.ActiveRecordBase.InternalCreate(Object
instance, Boolean flush)
at Castle.ActiveRecord.ActiveRecordBase.Create(Object instance)
at Castle.ActiveRecord.ActiveRecordBase.Create()
at RunApplications.Data.Providers.BaseProvider`1.Add(T record) in C:
\development2\In Progress\RunApplications\RunApplications.Data
\Providers\BaseProvider.cs:line 25
at RunProcessor.GroupedImport.Execute(RunImport import) in C:
\development2\In Progress\RunApplications\RunProcessor\ImportEngine
\GroupedImport.cs:line 46
at RunProcessor.ImportEngine.Execute(RunImport import) in C:
\development2\In Progress\RunApplications\RunProcessor\ImportEngine
\ImportEngine.cs:line 28
at RunProcessor.Processor.ProcessImports(ImportCollection imported,
String filename) in C:\development2\In Progress\RunApplications
\RunProcessor\Processor.cs:line 133
Inner Exception:
could not insert: [RunApplications.Data.Models.Run][SQL: INSERT INTO
RunMaster (Version, RunNumber, CompanyID, Ink1, Ink2, Initials,
GoSetCode, RunHeaderType, Plant, StockItem, RunQuantity,
SpillageQuantity, RushPriority, NumberUp, UniqueOrders, DueOrders,
ServiceLevel, StatusID, GroupedDate, DateAdded, PressDate,
EarliestShipDate, LastUpdated, IsLaserProofed, OnHold, HoldReason,
DepartmentTrack, RunInstructions, ReportID, StagingID,
StagingTicketGeneratedOn, LastUpdatedBy, ProductTypeID, RunClassID,
GroupTypeID) VALUES
(?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)]
Inner Exception Trace:
at
NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object[]
fields, Boolean[] notNull, SqlCommandInfo sql, Object obj,
ISessionImplementor session)
at
NHibernate.Persister.Entity.AbstractEntityPersister.Insert(Object[]
fields, Object obj, ISessionImplementor session)
at NHibernate.Impl.ScheduledIdentityInsertion.Execute()
at NHibernate.Impl.SessionImpl.Execute(IExecutable executable)
at NHibernate.Impl.SessionImpl.DoSave(Object theObj, EntityKey key,
IEntityPersister persister, Boolean replicate, Boolean
useIdentityColumn, CascadingAction cascadeAction, Object anything)
at NHibernate.Impl.SessionImpl.DoSave(Object obj, Object id,
IEntityPersister persister, Boolean useIdentityColumn, CascadingAction
cascadeAction, Object anything)
at NHibernate.Impl.SessionImpl.SaveWithGeneratedIdentifier(Object
obj, CascadingAction action, Object anything)
at NHibernate.Impl.SessionImpl.Save(Object obj)
at Castle.ActiveRecord.ActiveRecordBase.InternalCreate(Object
instance, Boolean flush)
}
*************************************************