@@ -80,12 +80,12 @@ public void testAdderAsSelect() {
80
80
* in a stored procedure.
81
81
* This procedure does not return a result set.
82
82
*
83
- * Currently this test will fail because of a MyBatis cache issue.
83
+ * Currently this test will fail without clearing the cache because
84
+ * of a MyBatis cache issue.
84
85
*
85
86
* This test shows using a multi-property parameter.
86
87
*/
87
88
@ Test
88
- @ Ignore ("until MyBatis cache issue fixed" )
89
89
public void testAdderAsSelectDoubleCall1 () {
90
90
SqlSession sqlSession = sqlSessionFactory .openSession ();
91
91
try {
@@ -98,8 +98,9 @@ public void testAdderAsSelectDoubleCall1() {
98
98
spMapper .adder (parameter );
99
99
assertEquals ((Integer ) 5 , parameter .getSum ());
100
100
101
- // this fails because there are two calls to the same SP with the same
102
- // parms in the same session.
101
+ // clear cache is required in this instance.
102
+ sqlSession .clearCache ();
103
+
103
104
parameter = new Parameter ();
104
105
parameter .setAddend1 (2 );
105
106
parameter .setAddend2 (3 );
@@ -259,10 +260,11 @@ public void testCallWithResultSet3() {
259
260
*
260
261
* This test shows using a Map parameter.
261
262
*
262
- * The cache problem is in effect with this test.
263
+ * Currently this test will fail without clearing the cache because
264
+ * of a MyBatis cache issue.
263
265
*/
264
266
@ Test
265
- @ Ignore ("until hsqldb 2.0.1 is released, and MyBatis cache issue fixed " )
267
+ @ Ignore ("until hsqldb 2.0.1 is released" )
266
268
public void testCallWithResultSet4 () {
267
269
SqlSession sqlSession = sqlSessionFactory .openSession ();
268
270
try {
@@ -274,11 +276,13 @@ public void testCallWithResultSet4() {
274
276
assertEquals (2 , parms .get ("totalRows" ));
275
277
assertEquals (2 , names .size ());
276
278
279
+ // clear cache is required in this instance.
280
+ sqlSession .clearCache ();
281
+
277
282
parms = new HashMap <String , Object >();
278
283
parms .put ("lowestId" , 2 );
279
284
names = spMapper .getNames (parms );
280
285
assertEquals (2 , names .size ());
281
- // fails because of cache problem
282
286
assertEquals (2 , parms .get ("totalRows" ));
283
287
} finally {
284
288
sqlSession .close ();
0 commit comments