If the database is empty (no tables created), the SchemaUpdate works fine, create all db objects and so. But if another call to SchemaUpdate is called, even if no Mappings or Objects were made, some action is made and finalizes with the error message "Column 'COLUMN_SIZE' does not belong to table" on schemaUpdate.Exceptions[0].

Stack trace: [HttpException (0x80004005): Column 'COLUMN_SIZE' does not belong to table .] System.Web.HttpApplicationFactory.EnsureAppStartCalledForIntegratedMode(HttpContext context, HttpApplication app) +9859725 System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +118 System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172 System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336 System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): Column 'COLUMN_SIZE' does not belong to table .] System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873912 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254

asked 14 Nov '12, 14:37

Tuschinski's gravatar image

Tuschinski
46115
accept rate: 0%

retagged 18 Nov '12, 11:57

Nica%20_SAP's gravatar image

Nica _SAP
866722

I'm having the same problem with SchemaValidate.

(13 Nov '13, 05:12) henginy

Hello,

When posting issues to the forum, please include a code sample so that we can reproduce your issue - this will assist us in understanding the precise issue you're seeing.

  1. Regarding hbm2ddl and updating schemas, it isn't generally recommended to run 'hbm2ddl.auto=update' in production and Hibernate does not generally expect DDL updates after start-up. So, in terms of NHibernate features, this issue should really only affect development/testing. For schema validations, the 'hbm2ddl.auto=validate' only needs to be run once upon start-up and can thus just be a Configuration property - you should not have to call NHibernate.Tool.hbm2ddl.SchemaValidate directly:

    Configuration cfg = new Configuration(); cfg.Properties["hbm2ddl.auto"] = "validate";

  2. This issue is caused by CR #631249 - any ADO.NET provider prior to these builds (10.0.1.4079, 11.0.1.2444, 12.0.0.1242) will not have the 'COLUMN_SIZE' issue. If you have an ADO.NET provider higher than these builds, the NHibernate 'Schema' files will have to be modified.

In \Dialect\Schema\SQLAnywhere11MetaData.cs (from Glenn Paulley's blog):

object objValue = rs["COLUMN_SIZE"];

becomes:

object objValue = rs["CHARACTER_MAXIMUM_LENGTH"];

In \Dialect\Schema\SybaseAnywhereMetaData.cs (from the default Hibernate install):

this.SetColumnSize(rs["COLUMN_SIZE"]);

becomes:

this.SetColumnSize(rs["CHARACTER_MAXIMUM_LENGTH"]);

I will investigate to see if we can open an NHibernate request to fix this issue in the official NHibernate package. Thank you for the bug report.

permanent link

answered 15 Nov '13, 15:09

Jeff%20Albion's gravatar image

Jeff Albion
10.8k171175
accept rate: 25%

edited 15 Nov '13, 15:12

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×438
×95
×25
×8
×4

question asked: 14 Nov '12, 14:37

question was seen: 7,801 times

last updated: 15 Nov '13, 15:12