PDA

View Full Version : Integrating IBatisNet with Spring.Net


lanore
03-20-2006, 02:00 PM
I'm integrating IBatisNet with Spring.Net, and It's not easy for me.

The problem is this,

Whenever i add "Spring.Data.IBatisNet.dll" reference into my project,

The studio reports two errors,

One is this

log4net Version=1.2.0.30714 Culture ... missmatch .. log4net Version=1.2.9.0 ...

and, the other is this

log4net Version=1.2.9.0 Culture ... missmatch .. log4net Version=1.2.0.30714 ...


I used these two versions

- Spring.NET-20051201-1228
- Spring.NET-20060317-2234

And, the result is same..

How can i do for solve this problem? Please.. :) somebody help me..


ps)

Using IBatisNet with Spring.Net is verified? I could find just one reference(http://plainvanilla.typepad.com/spring/2005/09/using_ibatisnet.html) about that.

So, if there are more.. please let me know

Mark Pollack
03-20-2006, 04:28 PM
Hi,

I need to revisit iBatis support in general and at a minimum bring it in line with the DbProvider abstraction we are using.

The issue you are having is that iBatis.NET 1.2.x uses log4.net 1.2.0 and Spring.NET uses 1.2.9 (the 'beta' which has been out forever...) I just checked that iBatis 1.3.0 beta uses log4net 1.2.9.0

Anyway, If you add this rebinding section to your application configuration file the issue should be resolved.


<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="log4net" publicKeyToken="b32731d11ce58905" culture="neutral" />
<bindingRedirect oldVersion="1.2.0.30714" newVersion="1.2.9.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>


Let me know if this helps you.

Cheers,
Mark

lanore
03-31-2006, 01:01 AM
Thank you for your reply, Mark..

however, I couldn't solve the problem..

As you mentioned, IBatis.Net 1.3.0 beta uses log4net 1.2.9.

but, Spring ibatis support dll uses IBatis.Net 1.2.9, so it made another

problem..

So, I decided to use NHibernate instead.. and it doesn't have problem..:)

Anyway, thank you for you reply again..

Have a nice day~!

smhinsey
04-03-2006, 05:56 PM
Mark,

I would be willing to help out where I can with the iBATIS integration, if you could just give me a quick overview of your vision for it.

Thanks,
Shawn

Mark Pollack
04-12-2006, 06:13 PM
Hi,

The current IBatis stuff doesn't use the DbProvider abstraction if I remember correctly, instead it takes a connection string directly. Moving it along the lines of how nhibernate/ado support is would be a big help.

Also there should be the ability to have ibatis participate in transaction already started via AdoTemplate and vice-versa. I think getting at the underlying tx object in ibatis isn't that simple in the .net version - it would be good to check.

There is also docs and a sample program, say based on the current simple springair database used in the web app or good 'ol northwind... Hmm, ping me privately and we can discuss more. I greatly appreciate your offer of help!

Cheers,
Mark

Mark Pollack
05-15-2006, 10:14 PM
Hi,
FYI, I was only able to get the binding redirect to work in my unit tests. You may try to work backwards from putting the redirect in machine.config.

Mark

Ted Husted
09-29-2006, 03:41 PM
I'm integrating IBatisNet with Spring.Net, and It's not easy for me.

The problem is this,

Whenever i add "Spring.Data.IBatisNet.dll" reference into my project,

The studio reports two errors,

One is this

log4net Version=1.2.0.30714 Culture ... missmatch .. log4net Version=1.2.9.0 ...

and, the other is this

log4net Version=1.2.9.0 Culture ... missmatch .. log4net Version=1.2.0.30714 ...


Just a note: iBATIS 1.5 bundles Log4Net 1.2.10, but it can use a prior version, and other logging clients as well.

If anyone is having a problem running iBATIS 1.5 with Spring.NET 1.0.2, just remove the Log4Net 1.2.10 assembly that comes with iBATIS, and iBATIS will fall back automatically.

-Ted.