Sponsored By Aspose - File Format APIs for .NET

Aspose are the market leader of .NET APIs for file business formats – natively work with DOCX, XLSX, PPT, PDF, MSG, MPP, images formats and many more!

Fun with O/R Mappers and the XNA Game Studio Express Beta

I've been running through a couple of O/R Mappers to understand
different features that are available- thanks to Paul Wilson's site for
pointing out other O/R Mappers worth looking at.  So far, I've
been impressed with both NHibernate and WilsonOR.  NHibernate
seems to have the most databases supported – or least one that I'm
interested in (Sybase). On the downside, it looks like NHibernate
specifically does not work with byte arrays used as Ident fields (don't
ask me, it's legacy).  I say specifically, because from what I can
see in the source, they are throwing an exception in this particular
case.

The WilsonORHelper is great for getting off the ground
quickly – I had my entire database in memory in less than an
hour.  64 bit .Net, here I come!  I need to crack open
CodeSmith to check out the CodeGen for these tools.

My next stop is figuring out if I can persist the objects to a
secondary process for the actual, physical database writing
process.  These could be persisted through a message queue as one
example. The threading issues that must be resolved to guarantee
the  appropriate chronological writing pattern along with the Unit
of Work pattern breakout is the more difficult problem to solve.

I
also got my XNA Game Studio Express Beta invitation today.  I
downloaded the toolkit and I'll probably install it this weekend.
Things are busy right now to be coding games, but I'll hopefully have
some time on a business trip next week.   I'll blog more as I play
around with it.

 

 

 

This entry was posted in Uncategorized. Bookmark the permalink. Follow any comments here with the RSS feed for this post.

2 Responses to Fun with O/R Mappers and the XNA Game Studio Express Beta

  1. shebert says:

    Hi Ayende,

    It’s in bindClass.BindRootClass() in the line:

    if ( id.getType().getReturnedClass().isArray() ) throw new MappingException(“illegal use of an array as an identifier (arrays don’t reimplement equals)”);

    I’ve playing around with using UserTypes, but without success so far.

  2. Byte arrays as identity field? Ouch!
    Can you point out where it is throwing?

    I would hazzard a guess saying that this is because NHibernate allows serializing objects to DB, and it may think that you tries to use serialized object as PK.

    In any case, you can use that still using a UserType

Leave a Reply