NHibernate for Advantage Database Server

Note: this post has been in my drafts for so long I’ve changed company and so this isn’t strictly relevant to me now. I developed this in my own time while working at my previous company and I figure it may come in useful to someone.

I’ve just been playing about with NHibernate and Advantage Database Server (ADS).

I’ve done some initial code to make NHibernate work with both DBF and ADT files.

I’ve put a sample solution up with both DBF and ADT configuration files.  I’ve created a dialect and a driver for them.  I’ve also found it necessary to create an ID provider in order to deal with the DBF’s.  Since the NHibernate team recommends using a HiLo ID creator however it seems to make sense for the ADT dialect to also specify that by default.  I found it necessary to create the ID provider because ADS provides an odd way to lock records that isn’t done via SQL, it’s done via their data provider classes.

This dialect does the bare minimum to support the sample I found at the start of my NHibernate In Action book.  It does no more.  It doesn’t do anything like type mapping or any of the other things a dialect normally does.

I’m not sure what to do with this next.  I have tried running it against the NHibernate tests but there are so many failures because I’ve not implemented the basic things it’s a bit hard to see where to go.

For now I think I’ll see if I can use it in practice and then see where the holes are.

The one less than ideal thing that I’ve had to do is with the IIdentifierGenerator is basically copy the bits of code I wanted from the TableGenerator class and then modify them as required.  I get the feeling that having to lock records in the manner I’ve needed to isn’t particularly common though.

To see the project and example download it from here.  You also need to download the Advantage Data Provider from http://devzone.advantagedatabase.com/dz/content.aspx?key=20&Release=13&Product=4&Platform=11.


2 thoughts on “NHibernate for Advantage Database Server

  1. Hi,

    I’currently working on a project using a legacy ADS database. When I was searching for some code samples on using Nhibernate, I found your blog post. Sadly the download is no longer available, any chance on sending it to me?


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s