ibatis-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Clinton Begin <clinton.be...@gmail.com>
Subject Re: Multiple connections in multiple threads doesn't seem to work.
Date Thu, 11 Aug 2005 15:59:49 GMT
If you haven't done so already, you should probably post this to the .NET 
list. You'll likely get a response there. The Dev list is mostly for design 
and feature discussion.


On 8/9/05, Louis Letourneau <louis.letourneau@mail.mcgill.ca> wrote:
> Hello,
> I hope I'm not reposting, my original message doesn't seem to have gotten 
> through...
> In Ibatis.NET with dataAccess 1.6.1, I'm trying to open many 
> (different)connections each in a seperate thread (as would occur in a web 
> application). I get connection already closed or connection already opened 
> exceptions when running the application. It's as if a new session doesn't 
> get created individually for each thread...
> I took the liberty of checking the source code of the datamapper, and 
> shouldn't the variable _localSqlMapSession in WindowSessionContainer.cs be 
> static. If it's not the ThreadStatic attirbute will have no effect and every 
> thread will have the same session (as in my case).
> I tested this theory in the attached code and, indeed the variable needs 
> to be static for the attribute to have effect.
> I checked in jira and couldn't find a similar bug. If there is one already 
> opened...sorry :-)
> I have the code to reproduce both problems if you want it. (the 
> ThreadStatic, and the openconnection)
> Exception:
> Got: IBatisNet.DataAccess.Exceptions.DataAccessException: DaoManager could 
> not i
> nvoke OpenConnection(). A connection is already started. Call 
> CloseConnection fi
> rst.
> I've been using the java dao for awhile now...great product! Very good job 
> guys.
> Thanks
> Louis

View raw message