One other note, I can update to the same table through a provider, just cannot add to the exact same table. Doesn't make sense!
On Jun 24, 9:17 am, scottl2001 <[email protected]> wrote: > 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) > > } > > ************************************************* -- You received this message because you are subscribed to the Google Groups "Castle Project Users" 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/castle-project-users?hl=en.
