Index: src/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs
===================================================================
--- src/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs (revision 903789)
+++ src/IBatisNet.DataMapper/MappedStatements/CachingStatement.cs (working copy)
@@ -30,6 +30,7 @@
using System.Collections.Generic;
#endif
using System.Data;
+using System.Threading;
using IBatisNet.DataMapper.Commands;
using IBatisNet.DataMapper.Configuration.Cache;
using IBatisNet.DataMapper.Configuration.Statements;
@@ -517,7 +518,8 @@
CacheModel cacheModel = _mappedStatement.Statement.CacheModel;
if (!cacheModel.IsReadOnly && !cacheModel.IsSerializable)
{
- cacheKey.Update(request);
+ // read/write, nonserializable cache models need to use per-session caching
+ cacheKey.Update(request.Session);
}
return cacheKey;
}
Index: src/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Account.xml
===================================================================
--- src/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Account.xml (revision 903789)
+++ src/IBatisNet.DataMapper.Test/Maps/MSSQL/OleDb/Account.xml (working copy)
@@ -15,8 +15,13 @@
-
-
+
+
+
+
+
+
+
Index: src/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Account.xml
===================================================================
--- src/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Account.xml (revision 903789)
+++ src/IBatisNet.DataMapper.Test/Maps/MSSQL/Odbc/Account.xml (working copy)
@@ -15,8 +15,17 @@
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -126,7 +135,7 @@
order by Account_ID
-
Index: src/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Account.xml
===================================================================
--- src/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Account.xml (revision 903789)
+++ src/IBatisNet.DataMapper.Test/Maps/MSSQL/SqlClient/Account.xml (working copy)
@@ -66,6 +66,11 @@
+
+
+
+
+
@@ -345,6 +350,11 @@
cacheModel="rw-account-cache" extends="GetCachedAccountsViaResultMap">
+
+
-
-
+
+
+
+
+
+
+
@@ -105,8 +110,13 @@
resultMap="account-result"
cacheModel="rw-account-cache" extends="GetCachedAccountsViaResultMap">
-
-
+
+