MySQL SchemaUpdate error

22 views
Skip to first unread message

DK-Warder

unread,
Mar 5, 2009, 4:06:09 AM3/5/09
to nhusers
I have got exception on SchemaUpdate with MySQL 5.1.31:

System.InvalidCastException: Specified cast is not valid.
at NHibernate.Tool.hbm2ddl.ColumnMetadata..ctor(DataRow rs)
at NHibernate.Tool.hbm2ddl.TableMetadata.AddColumn(DataRow rs)
at NHibernate.Tool.hbm2ddl.TableMetadata.InitColumns(ISchemaReader
meta)
at NHibernate.Tool.hbm2ddl.TableMetadata..ctor(DataRow rs,
ISchemaReader meta, Boolean extras)
at NHibernate.Tool.hbm2ddl.DatabaseMetadata.GetTableMetadata(String
name, String schema)
at NHibernate.Cfg.Configuration.GenerateSchemaUpdateScript(Dialect
dialect, DatabaseMetadata databaseMetadata)
at NHibernate.Tool.hbm2ddl.SchemaUpdate.Execute(Boolean script,
Boolean doUpdate)

My config:
<property
name="connection.driver_class">NHibernate.Driver.MySqlDataDriver</
property>
<property name="dialect">NHibernate.Dialect.MySQL5Dialect</property>

SchemaExport works fine.

Fabio Maulo

unread,
Mar 5, 2009, 7:28:13 AM3/5/09
to nhu...@googlegroups.com
MySQL don't has a specific metadata provider implemented.
The work to create one is not so complicated; Take a look to src\NHibernate\Dialect\Schema and please send us a patch for your preferred RDBMS (MySQL).

Thanks.

2009/3/5 DK-Warder <dkwa...@gmail.com>



--
Fabio Maulo

DK-Warder

unread,
Mar 6, 2009, 3:38:53 AM3/6/09
to nhusers
I have completed work. Patch was sent on nhibernate-development (at)
lists (dot) sourceforge.net

On 5 мар, 17:28, Fabio Maulo <fabioma...@gmail.com> wrote:
> MySQL don't has a specific metadata provider implemented.The work to create
> one is not so complicated; Take a look to src\NHibernate\Dialect\Schema and
> please send us a patch for your preferred RDBMS (MySQL).
>
> Thanks.
>
> 2009/3/5 DK-Warder <dkwar...@gmail.com>

Tuna Toksoz

unread,
Mar 6, 2009, 3:42:37 AM3/6/09
to nhu...@googlegroups.com
Can you also send it to http://jira.nhforge.org

Tuna Toksöz
http://tunatoksoz.com
http://turkiyealt.net
http://twitter.com/tehlike

Typos included to enhance the readers attention!



2009/3/6 DK-Warder <dkwa...@gmail.com>

DK-Warder

unread,
Mar 6, 2009, 3:43:44 AM3/6/09
to nhusers
Email was rejected... I forward it to nhibernate-
devel...@googlegroups.com

DK-Warder

unread,
Mar 6, 2009, 3:53:28 AM3/6/09
to nhusers
http://nhjira.koah.net/browse/NH-1695

On 6 мар, 13:42, Tuna Toksoz <tehl...@gmail.com> wrote:
> Can you also send it tohttp://jira.nhforge.org
>
> Tuna Toksözhttp://tunatoksoz.comhttp://turkiyealt.nethttp://twitter.com/tehlike
>
> Typos included to enhance the readers attention!
>
> 2009/3/6 DK-Warder <dkwar...@gmail.com>

Davy Brion

unread,
Mar 6, 2009, 6:55:25 AM3/6/09
to nhu...@googlegroups.com
applied in revision 4118, thanks

Sushant

unread,
Mar 17, 2009, 2:31:38 AM3/17/09
to nhusers
Has this been applied to MS SQL (Compact Edition) or SQLite ? With
SchemaUpdate.Execute I get exactly the same error using both these
datatypes..

Sushant

unread,
Mar 17, 2009, 2:39:18 AM3/17/09
to nhusers
Has this been applied to MSSQLCE and SQLite? I'm getting exactly the
same error on both when I use SchemaUpdate......

Fabio Maulo

unread,
Mar 17, 2009, 9:19:01 AM3/17/09
to nhu...@googlegroups.com
on trunk NH2.1.0Alpha1 SQLite has Metadata classes for schema Update/Validation.
MsSQL Ce don't has metadata.
The work to create one is not so complicated; Take a look to src\NHibernate\Dialect\Schema and please send us a patch for your preferred RDBMS (MsSQL Ce).
Thanks

2009/3/17 Sushant <mpsk...@gmail.com>


Has this been applied to MSSQLCE and SQLite? I'm getting exactly the
same error on both when I use SchemaUpdate......





--
Fabio Maulo
Message has been deleted

Sushant

unread,
Mar 18, 2009, 8:28:28 AM3/18/09
to nhusers
Here's the patch:

http://nhjira.koah.net/secure/attachment/12721/MsSqlCeMetaData.patch

On Mar 17, 6:19 pm, Fabio Maulo <fabioma...@gmail.com> wrote:
> on trunk NH2.1.0Alpha1 SQLite has Metadata classes for schema
> Update/Validation.MsSQL Ce don't has metadata.
> The work to create one is not so complicated; Take a look to
> src\NHibernate\Dialect\Schema and please send us a patch for your preferred
> RDBMS (MsSQL Ce).
> Thanks
>
> 2009/3/17 Sushant <mpsk2...@gmail.com>

Fabio Maulo

unread,
Mar 18, 2009, 8:33:54 AM3/18/09
to nhu...@googlegroups.com
What happen ?
2 patches here 3 patches there... easy... easy...

The correct is the one of 5K ?

2009/3/18 Sushant <mpsk...@gmail.com>



--
Fabio Maulo

Sushant

unread,
Mar 18, 2009, 8:46:37 AM3/18/09
to nhusers
Yes.. the 5 K one is correct.. sorry bout that .. lol :D

On Mar 18, 5:33 pm, Fabio Maulo <fabioma...@gmail.com> wrote:
> What happen ?2 patches here 3 patches there... easy... easy...
>
> The correct is the one of 5K ?
>
> 2009/3/18 Sushant <mpsk2...@gmail.com>
Reply all
Reply to author
Forward
0 new messages