Bug? 2.1.0GA, MySQL, ReservedWords

116 views
Skip to first unread message

William Chang

unread,
Jul 20, 2009, 1:05:59 PM7/20/09
to nhusers
I'm getting an exception from my simple NUnit test, creating a user:
System.ArgumentException : Column 'Reserved Word' does not belong to
table ReservedWords.

I don't think I'm using any reserve words in my simple "Users" table.
Maybe, it could be happening on my side or NHibernate? Please help? Is
there a workaround or a solution?

For your information, it was working during NHibernate, beta release.

Specs:
Microsoft ASPNET 3.5
MySQL 5.0.24a
MySQL Connector/Net 6.0.4
NHibernate 2.1.0GA
Castle ActiveRecord 2.0 Beta1

Stack Trace:
at System.Data.DataRow.GetDataColumn(String columnName)
at System.Data.DataRow.get_Item(String columnName)
at NHibernate.Dialect.Schema.MySQLDataBaseSchema.GetReservedWords()
at NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.GetReservedWords
(Dialect dialect, IConnectionHelper connectionHelper)
at NHibernate.Tool.hbm2ddl.SchemaMetadataUpdater.Update
(ISessionFactory sessionFactory)
at NHibernate.Impl.SessionFactoryImpl..ctor(Configuration cfg,
IMapping mapping, Settings settings, EventListeners listeners)
at NHibernate.Cfg.Configuration.BuildSessionFactory()
at Castle.ActiveRecord.Framework.SessionFactoryHolder.GetSessionFactory
(Type type)
at
Castle.ActiveRecord.Framework.SessionFactoryHolder.CreateScopeSession
(Type type)
at Castle.ActiveRecord.Framework.SessionFactoryHolder.CreateSession
(Type type)
at Castle.ActiveRecord.ActiveRecordBase.InternalCreate(Object
instance, Boolean flush)
at Castle.ActiveRecord.ActiveRecordBase.Create()
at Vendorsoft.Data.Tests.ModelsTests.createUser() in C:\Documents
\Visual Studio 2008\Projects\Vendorsoft\Data.Tests\ModelsTests.cs:line
22
at Vendorsoft.Data.Tests.ModelsTests.User() in C:\Documents\Visual
Studio 2008\Projects\Vendorsoft\Data.Tests\ModelsTests.cs:line 29

Source Code:
protected Data.Models.User createUser() {
Data.Models.User obj1;
obj1 = new Vendorsoft.Data.Models.User {
userAlias = "diehard",
userNameFirst = "William",
userNameLast = "Chang",
userEmail = "te...@mail.com",
userDateCreated = DateTime.Now
};
obj1.Create();

return obj1;
}

create table Users (
userId VARCHAR(40) not null,
userAlias VARCHAR(64) not null,
userNameFirst VARCHAR(64) not null,
userNameLast VARCHAR(64) not null,
userEmail TEXT not null,
userDateCreated DATETIME not null,
userIsDeleted TINYINT(1) default 0 not null,
primary key (userId)
)

Sincerely,
Will

Fabio Maulo

unread,
Jul 20, 2009, 4:08:29 PM7/20/09
to nhu...@googlegroups.com
disable the keywords auto-import or try to fix the schema-metadata implementation



--
Fabio Maulo

Frederic

unread,
Jul 20, 2009, 7:46:41 PM7/20/09
to nhu...@googlegroups.com
Dear all,

Just to inform you, because we are pretty proud of what we achieved.

For the project description :
Nexfi is a french based software provider adressing mainly asset
management industry (insurance, mutual funds, pensions funds, hedged funds).
In our client base, we have name like Jp morgan, morgan stanley,
harewood/BNP Paribas.
The product is used for portfolio management, order management, cash
management, front to back accounting, data integration and
reconciliation,etc,etc...

We sucessfully deliver in time the first release of our new product and
the persistence layer is entirely build on top of NHibernate (2.0).
Using Nhibernate we get the opportunity to entirely redesigned the
database and the delivery process, including both oracle and sql server
support. The application is built on N-tiers (WCF using XML/Bin -
TCP-HTTP), with a distributed cache engine, using a smart client, as
well as a thin client for global application administration (messaging
services, integration and scheduling) and reporting portal (asp.net /
winforms / webpats).

We are especially happy with our Nhibernate implementation and with the
very flexible object graph control provided by Nhibernate. We hopefully
will continue with this framework and try to work on our own DB provider
to enhance schemas updates / creations as well as specific queries.

For the number, we have a base of 1200+Entities, including read only /
lightweight entities, with a very complex business logic making the
object graph a real madness, but Nhibernate allowed us to do the job at
the simple cost of learning, searching and putting some breakpoints in
the sources.

From a technical point of view, Nhibernate was initialy chosen because :
- Project Manager coming from J2EE (hehe)
- Ranked first in our ORM/Mapper Benchmark facing...
* iBatis
* Linq2Sql
* Entity Framework
* Subsonic
* LLblGen
* Xpo

2 things I need to say :
Fabio, I'm sorry about the WCF unit tests, we had some rush, I should
have now
For all of you guys who worked hard to deliver this open-source
framework...Well...Thank you!

From the documentation to support through code availability, unit test
base, you are a living reference of the Open Source mindset for the all
the .Net community.

Fred.


Tuna Toksoz

unread,
Jul 20, 2009, 7:53:04 PM7/20/09
to nhu...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages