I am trying to implement a small framework for myself based on Spring and NHibernate which I could use from now on for my upcoming projects. The DAL is based on sandbox code for Data Access.
My question is: beside Spring.Data.SqlProvider and Spring.Data.Support.Oracle.OracleClientProvider are there any other providers for different databases? I am particulary interested in MySQL provider.
Hi,
There is one for the Oracle ODP.NET provider, i.e. what you get from Oracle Corp, not MS-Corp. A MySql one should be straightforward to implement. I'd be grateful if you gave it a shot. The only impl detail I can think of that isn't so obvious is to use the string "MySQL" as the name since that is the name used in sql-error-codes.xml for use in exception translation.
In anycase, let me know if you need any help getting going with coding up a MySql provider or any other data access issues - the docs are ..er..lacking to say the least right now.
Cheers,
Mark
BTW - I would like to switch to providers being all config driven - like ibatis - but there are some bits of code in there that maybe hard to generalize.
I'm in the middle of writing the MySqlProvider. It was pretty straight forward to write but i need to do more integration testing to make sure things are ok. I'm using the MySQL Connector/Net 1.0.7 driver. I should be finished it in the next couple of days. I'm also looking at the integration with NHibernate. I noticed that the HibernateTransactionManager is not able to lookup the DbProvider from the SessionFactory. So i'll have a look at that as well.
Hi,
Thanks for the code! I've updated the JIRA issue. Looking up a Spring "DbProvider" from NHibernate seems to be a task of mapping an IDriver impl to a DbProvier impl. This is again the ugly side effect of .NET 1.1 not having a common database provider abstraction. There maybe a more elegant way out for .NET 2.0. Is the need for this feature simply a configuration management issue (configure the db connection layer once and do it the NHibernate way) or something deeper?
I have taken an old version of the MySQLProvider found on a Jira and I updated to the new Spring version. The changes were very simple but anyway I uploaded here because I think it could be useful.
I´ve see how this providers are implemented, because I have to write a SyBase Provider now and I found that all providers implementation looks exactly the same way. I think we can restructure the AbstractProvider definition to make concrete implementation a little more simpler. Just an idea.
I have no problems in be more specific or code it. Just tell me.