on 2012 Nov 14 2:37 PM
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
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.
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";
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
71 | |
11 | |
10 | |
10 | |
10 | |
8 | |
7 | |
7 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.