Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Duplicate
-
DataMapper 1.2.1
-
None
Description
There was a bug like this fixed for the DataAccess component, but the problem is still in the DataMapper component.
Inside the IBatisNet.DataMapper.SessionContainer.WindowSessionContainer class, the private variable _localSqlMapSession is decorated with the ThreadStatic attribute, but it is not declared as a static variable so the attibute is ignored.
The DataMapper will only allow a single connection/transaction since there is only one _localSqlMapSession across all threads.
Current Code:
[ThreadStatic]
private SqlMapSession _localSqlMapSession = null;
Working Fix:
[ThreadStatic]
private static SqlMapSession _localSqlMapSession = null;