0

How can i correct the following error? Can't run SpecFlow test as there is the error.

  NHibernate.AdoNet.AbstractBatcher Error: 0 : Could not execute command: INSERT INTO ..._TaxonomyCatalogPartRecord (General, Reproduction, Identification, Culture, Evolution, Morphology, Id) VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6)
  NHibernate.Util.ADOExceptionReporter Error: 0 : The column name is not valid. [ Node name (if any) = ,Column name = Evolution ]
  Orchard.ContentManagement.DefaultContentManager Error: 0 : GenericADOException thrown from IContentHandler by Orchard.Autoroute.Handlers.AutoroutePartHandler
  NHibernate.AssertionFailure Error: 0 : An AssertionFailure occurred - this may indicate a bug in NHibernate or in your custom types.
  NHibernate.Impl.AbstractSessionImpl Error: 0 : DTC transaction prepre phase failed

The two columns weren't created for a TaxonomyCatalogPartRecord of my module. It seems that the Migrations of my module wasn't run correctly.

The Migrations have the following methods:

  1. "Create()" returns 5
  2. "UpdateFrom5()" returns 8
  3. "UpdateFrom8()" returns 9
  4. "UpdateFrom9()" returns 10

The table is created in Create():

SchemaBuilder.CreateTable(
                "TaxonomyCatalogPartRecord",
                table =>
                table
                    .ContentPartRecord()
                    .Column<string>("General", c => c.Unlimited())
                    .Column<string>("Reproduction", c => c.Unlimited())
                    .Column<string>("Identification", c => c.Unlimited())
                    .Column<string>("Culture", c => c.Unlimited())
                );

The two columns are added in UpdateFrom9() with the following code:

SchemaBuilder.AlterTable("TaxonomyCatalogPartRecord", t => {
                t.AddColumn<string>("Evolution");
                t.AddColumn<string>("Morphology");
            });

Also there were the following errors during SpecFlow run:

  NHibernate.AdoNet.AbstractBatcher Error: 0 : Could not execute query: SELECT this_.Id as Id11_0_, this_.SerialNumber as SerialNu2_11_0_ FROM Settings_ShellDescriptorRecord this_ WHERE 1=1
  NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Settings_ShellDescriptorRecord ]
  NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Settings_ShellDescriptorRecord ]

And the following:

 NHibernate.AdoNet.AbstractBatcher Error: 0 : Could not execute query: 

  SELECT this_.Id as Id338_6_, this_.Number as Number338_6_, this_.Published as Published338_6_, this_.Latest as Latest338_6_, this_.Data as Data338_6_, this_.ContentItemRecord_id as ContentI6_338_6_, autoroutep4_.Id as Id269_0_, autoroutep4_.UseCustomPattern as UseCusto2_269_0_, autoroutep4_.CustomPattern as CustomPa3_269_0_, autoroutep4_.DisplayAlias as DisplayA4_269_0_, autoroutep4_.ContentItemRecord_id as ContentI5_269_0_, titlepartr5_.Id as Id270_1_, titlepartr5_.Title as Title270_1_, titlepartr5_.ContentItemRecord_id as ContentI3_270_1_, contentite1_.Id as Id337_2_, contentite1_.Data as Data337_2_, contentite1_.ContentType_id as ContentT3_337_2_, termpartre2_.Id as Id273_3_, termpartre2_.TaxonomyId as TaxonomyId273_3_, termpartre2_.Path as Path273_3_, termpartre2_.Count as Count273_3_, termpartre2_.Selectable as Selectable273_3_, termpartre2_.Weight as Weight273_3_, commonpart8_.Id as Id294_4_, commonpart8_.OwnerId as OwnerId294_4_, commonpart8_.CreatedUtc as CreatedUtc294_4_, commonpart8_.PublishedUtc as Publishe4_294_4_, commonpart8_.ModifiedUtc as Modified5_294_4_, commonpart8_.Container_id as Container6_294_4_, contenttyp9_.Id as Id339_5_, contenttyp9_.Name as Name339_5_ 

  FROM Orchard_Framework_ContentItemVersionRecord this_ left outer join Orchard_Autoroute_AutoroutePartRecord autoroutep4_ on this_.Id=autoroutep4_.Id left outer join Title_TitlePartRecord titlepartr5_ on this_.Id=titlepartr5_.Id inner join Orchard_Framework_ContentItemRecord contentite1_ on this_.ContentItemRecord_id=contentite1_.Id inner join Contrib_Taxonomies_TermPartRecord termpartre2_ on contentite1_.Id=termpartre2_.Id left outer join Common_CommonPartRecord commonpart8_ on contentite1_.Id=commonpart8_.Id left outer join Orchard_Framework_ContentTypeRecord contenttyp9_ on contentite1_.ContentType_id=contenttyp9_.Id WHERE this_.Published = @p0

  NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Contrib_Taxonomies_TermPartRecord ]
  NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Contrib_Taxonomies_TermPartRecord ]
  Orchard.Exceptions.DefaultExceptionPolicy Error: 0 : An unexpected exception was caught
  NHibernate.AdoNet.AbstractBatcher Error: 0 : Could not execute query: SELECT this_.Id as Id338_6_, this_.Number as Number338_6_, this_.Published as Published338_6_, this_.Latest as Latest338_6_, this_.Data as Data338_6_, this_.ContentItemRecord_id as ContentI6_338_6_, autoroutep4_.Id as Id269_0_, autoroutep4_.UseCustomPattern as UseCusto2_269_0_, autoroutep4_.CustomPattern as CustomPa3_269_0_, autoroutep4_.DisplayAlias as DisplayA4_269_0_, autoroutep4_.ContentItemRecord_id as ContentI5_269_0_, titlepartr5_.Id as Id270_1_, titlepartr5_.Title as Title270_1_, titlepartr5_.ContentItemRecord_id as ContentI3_270_1_, contentite1_.Id as Id337_2_, contentite1_.Data as Data337_2_, contentite1_.ContentType_id as ContentT3_337_2_, taxonomypa2_.Id as Id272_3_, taxonomypa2_.TermTypeName as TermType2_272_3_, commonpart8_.Id as Id294_4_, commonpart8_.OwnerId as OwnerId294_4_, commonpart8_.CreatedUtc as CreatedUtc294_4_, commonpart8_.PublishedUtc as Publishe4_294_4_, commonpart8_.ModifiedUtc as Modified5_294_4_, commonpart8_.Container_id as Container6_294_4_, contenttyp9_.Id as Id339_5_, contenttyp9_.Name as Name339_5_ FROM Orchard_Framework_ContentItemVersionRecord this_ left outer join Orchard_Autoroute_AutoroutePartRecord autoroutep4_ on this_.Id=autoroutep4_.Id left outer join Title_TitlePartRecord titlepartr5_ on this_.Id=titlepartr5_.Id inner join Orchard_Framework_ContentItemRecord contentite1_ on this_.ContentItemRecord_id=contentite1_.Id inner join Contrib_Taxonomies_TaxonomyPartRecord taxonomypa2_ on contentite1_.Id=taxonomypa2_.Id left outer join Common_CommonPartRecord commonpart8_ on contentite1_.Id=commonpart8_.Id left outer join Orchard_Framework_ContentTypeRecord contenttyp9_ on contentite1_.ContentType_id=contenttyp9_.Id WHERE this_.Published = @p0
  NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Contrib_Taxonomies_TaxonomyPartRecord ]
  NHibernate.Util.ADOExceptionReporter Error: 0 : The specified table does not exist. [ Contrib_Taxonomies_TaxonomyPartRecord ]
  Orchard.Exceptions.DefaultExceptionPolicy Error: 0 : An unexpected exception was caught
3
  • SchemaBuilder.AlterTable("TaxonomyCatalogPartRecord", t => t.AddColumn<string>("Evolution")); SchemaBuilder.AlterTable("TaxonomyCatalogPartRecord", t => t.AddColumn<string>("Morphology"));
    – Hazza
    Aug 30, 2012 at 15:31
  • Hazza, it really helped. Thank you! Why did that dividing make the error solved?
    – Artyom
    Aug 31, 2012 at 6:19
  • I guess either it doesn't allow you to do multiple alterations to a table at the same time, or possibly your syntax is wrong and you shouldn't have ';' after each .AddColumn but have a ',' separating them. At least it works, I'll add it as an answer to help other people
    – Hazza
    Sep 1, 2012 at 14:59

1 Answer 1

0

Change your AlterTable method to two separate calls of the AlterTable method, like so:

   SchemaBuilder.AlterTable("TaxonomyCatalogPartRecord", t => t.AddColumn<string>("Evolution")); 
   SchemaBuilder.AlterTable("TaxonomyCatalogPartRecord", t => t.AddColumn<string>("Morphology"));

Or possibly your syntax is wrong and it should be

SchemaBuilder.AlterTable("TaxonomyCatalogPartRecord", t => {
                t.AddColumn<string>("Evolution"),
                t.AddColumn<string>("Morphology")
            });

But I'm not sure about that one. Good luck

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.