Search code examples
nhibernate.net-3.5schemasql-server-cecastle-activerecord

Castle Active Record NHibernate Sql Server Ce 3.5 (SqlServerCe) Problem Updating Schema


I am trying to Update Schema on SQL Server CE 3.5 using Active Record by Castle. I have encountered an error - exception on the bottom.

I believe it is not a new issue, but I could not find a walk around for this issue. When trying to Update Schema using Active Record I get an exception. It seems that there is a wrong GetSchema call. It should be System.Data.SqlServerCe.SqlCeConnection.GetSchema() instead of DbConnection.GetSchema(). I got this information from here.

I am looking for resolution, not just information that it is MS problem. It is my problem right now, and possibly other people as well.

Exception: System.NotSupportedException: The method is not supported.

in System.Data.Common.DbConnection.GetSchema(String collectionName, String[] restrictionValues) in NHibernate.Dialect.Schema.AbstractDataBaseSchema.GetTables(String catalog, String schemaPattern, String tableNamePattern, String[] types) in NHibernate.Tool.hbm2ddl.DatabaseMetadata.GetTableMetadata(String name, String schema, String catalog, Boolean isQuoted) in NHibernate.Cfg.Configuration.GenerateSchemaUpdateScript(Dialect dialect, DatabaseMetadata databaseMetadata) in NHibernate.Tool.hbm2ddl.SchemaUpdate.Execute(Action`1 scriptAction, Boolean doUpdate)


Solution

  • SQL Server CE 4.0 implements GetSchema(). If you can't upgrade I guess you're SOL...