From 74e3f27300cd18b95920f99e8a512f399df56478 Mon Sep 17 00:00:00 2001 From: liuyueve <39432700+liuyueve@users.noreply.github.com> Date: Tue, 8 Sep 2020 12:12:09 +0800 Subject: [PATCH 01/10] BlockingCache death lock test --- .../blocking_cache/BlockingCacheTest.java | 30 +++++++++++++++++++ .../blocking_cache/PersonMapper.java | 3 ++ 2 files changed, 33 insertions(+) diff --git a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java index 90b8fcd9023..7074f3711f7 100644 --- a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java +++ b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java @@ -16,8 +16,10 @@ package org.apache.ibatis.submitted.blocking_cache; import java.io.Reader; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import org.apache.ibatis.BaseDataTest; import org.apache.ibatis.io.Resources; @@ -99,4 +101,32 @@ void ensureLockIsReleasedOnRollback() { mapper.findAll(); } } + + @Test + void blockCacheDeathLockTest() throws InterruptedException { + CountDownLatch count = new CountDownLatch(1); + Runnable run = () -> { + try (SqlSession session1 = sqlSessionFactory.openSession(); + SqlSession session2 = sqlSessionFactory.openSession()) { + + PersonMapper mapper1 = session1.getMapper(PersonMapper.class); + PersonMapper mapper2 = session2.getMapper(PersonMapper.class); + + mapper1.findById(1); + mapper2.findById(2); + + mapper1.findById(2); + mapper2.findById(1); + + session1.commit(); + session2.commit(); + count.countDown(); + } + }; + new Thread(run).start(); + boolean await = count.await(20, TimeUnit.SECONDS); + if (!await) { + throw new RuntimeException("BlockingCache made death lock"); + } + } } diff --git a/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java b/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java index 8449d14a074..328ce487ed9 100644 --- a/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java +++ b/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java @@ -27,6 +27,9 @@ public interface PersonMapper { @Select("select id, firstname, lastname from person") List findAll(); + @Select("select id, firstname, lastname from person where id = #{id}") + List findById(int id); + @Delete("delete from person where id = #{id}") int delete(int id); } From 3a542a4e3cd34d4f288a5f8dfaef9fc04263e210 Mon Sep 17 00:00:00 2001 From: liuyueve <39432700+liuyueve@users.noreply.github.com> Date: Tue, 8 Sep 2020 12:33:41 +0800 Subject: [PATCH 02/10] update test case --- .../blocking_cache/BlockingCacheTest.java | 81 +++++++++++-------- 1 file changed, 47 insertions(+), 34 deletions(-) diff --git a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java index 7074f3711f7..1f86a915f23 100644 --- a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java +++ b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java @@ -1,17 +1,17 @@ /** - * Copyright 2009-2020 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2009-2020 the original author or authors. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.ibatis.submitted.blocking_cache; @@ -104,29 +104,42 @@ void ensureLockIsReleasedOnRollback() { @Test void blockCacheDeathLockTest() throws InterruptedException { - CountDownLatch count = new CountDownLatch(1); - Runnable run = () -> { - try (SqlSession session1 = sqlSessionFactory.openSession(); - SqlSession session2 = sqlSessionFactory.openSession()) { - - PersonMapper mapper1 = session1.getMapper(PersonMapper.class); - PersonMapper mapper2 = session2.getMapper(PersonMapper.class); - - mapper1.findById(1); - mapper2.findById(2); - - mapper1.findById(2); - mapper2.findById(1); - - session1.commit(); - session2.commit(); - count.countDown(); + CountDownLatch step = new CountDownLatch(2); + CountDownLatch waitForExecute = new CountDownLatch(2); + + new Thread(() -> { + try (SqlSession sqlSession = sqlSessionFactory.openSession()) { + PersonMapper mapper = sqlSession.getMapper(PersonMapper.class); + mapper.findById(1); + step.countDown(); + step.await(); + + mapper.findById(2); + sqlSession.commit(); + } catch (InterruptedException e) { + //ignore + } + waitForExecute.countDown(); + }).start(); + + new Thread(() -> { + try (SqlSession sqlSession = sqlSessionFactory.openSession()) { + PersonMapper mapper = sqlSession.getMapper(PersonMapper.class); + mapper.findById(2); + step.countDown(); + step.await(); + + mapper.findById(1); + sqlSession.commit(); + } catch (InterruptedException e) { + //ignore } - }; - new Thread(run).start(); - boolean await = count.await(20, TimeUnit.SECONDS); + waitForExecute.countDown(); + }).start(); + + boolean await = waitForExecute.await(30, TimeUnit.SECONDS); if (!await) { - throw new RuntimeException("BlockingCache made death lock"); + throw new RuntimeException("BlockingCache has a risk of death lock!"); } } } From 864f24b43210471e436a5c0a4d597f0ac41bba4d Mon Sep 17 00:00:00 2001 From: liuyueve <39432700+liuyueve@users.noreply.github.com> Date: Tue, 8 Sep 2020 12:36:21 +0800 Subject: [PATCH 03/10] Update BlockingCacheTest.java --- .../blocking_cache/BlockingCacheTest.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java index 1f86a915f23..cb1c5f8c172 100644 --- a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java +++ b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java @@ -1,17 +1,17 @@ /** - * Copyright 2009-2020 the original author or authors. - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *

- * http://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2009-2019 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.ibatis.submitted.blocking_cache; @@ -128,7 +128,7 @@ void blockCacheDeathLockTest() throws InterruptedException { mapper.findById(2); step.countDown(); step.await(); - + mapper.findById(1); sqlSession.commit(); } catch (InterruptedException e) { From 2efa46cfc9b8421a7cc5e75f185cbae0ea291db4 Mon Sep 17 00:00:00 2001 From: liuyueve <39432700+liuyueve@users.noreply.github.com> Date: Tue, 8 Sep 2020 12:48:03 +0800 Subject: [PATCH 04/10] update BlockingCacheTest License --- .../ibatis/submitted/blocking_cache/BlockingCacheTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java index cb1c5f8c172..c548b6a5196 100644 --- a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java +++ b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2009-2019 the original author or authors. + * Copyright 2009-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 6361028fd81768e67c5d3167d99985902502274d Mon Sep 17 00:00:00 2001 From: liuyueve <39432700+liuyueve@users.noreply.github.com> Date: Tue, 8 Sep 2020 12:57:20 +0800 Subject: [PATCH 05/10] Revert "update BlockingCacheTest License" This reverts commit 2efa46cfc9b8421a7cc5e75f185cbae0ea291db4. --- .../ibatis/submitted/blocking_cache/BlockingCacheTest.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java index c548b6a5196..cb1c5f8c172 100644 --- a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java +++ b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java @@ -1,5 +1,5 @@ /** - * Copyright 2009-2020 the original author or authors. + * Copyright 2009-2019 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. From 1a919db6ea5810cbdd8e6991e41ad941b205e13e Mon Sep 17 00:00:00 2001 From: liuyueve <39432700+liuyueve@users.noreply.github.com> Date: Tue, 8 Sep 2020 12:57:23 +0800 Subject: [PATCH 06/10] Revert "Update BlockingCacheTest.java" This reverts commit 864f24b43210471e436a5c0a4d597f0ac41bba4d. --- .../blocking_cache/BlockingCacheTest.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java index cb1c5f8c172..1f86a915f23 100644 --- a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java +++ b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java @@ -1,17 +1,17 @@ /** - * Copyright 2009-2019 the original author or authors. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2009-2020 the original author or authors. + *

+ * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + *

+ * http://www.apache.org/licenses/LICENSE-2.0 + *

+ * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.ibatis.submitted.blocking_cache; @@ -128,7 +128,7 @@ void blockCacheDeathLockTest() throws InterruptedException { mapper.findById(2); step.countDown(); step.await(); - + mapper.findById(1); sqlSession.commit(); } catch (InterruptedException e) { From a723f692e0d6809ffecba2105fe1a7c1e91944bd Mon Sep 17 00:00:00 2001 From: liuyueve <39432700+liuyueve@users.noreply.github.com> Date: Tue, 8 Sep 2020 12:57:26 +0800 Subject: [PATCH 07/10] Revert "update test case" This reverts commit 3a542a4e3cd34d4f288a5f8dfaef9fc04263e210. --- .../blocking_cache/BlockingCacheTest.java | 81 ++++++++----------- 1 file changed, 34 insertions(+), 47 deletions(-) diff --git a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java index 1f86a915f23..7074f3711f7 100644 --- a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java +++ b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java @@ -1,17 +1,17 @@ /** - * Copyright 2009-2020 the original author or authors. - *

- * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - *

- * http://www.apache.org/licenses/LICENSE-2.0 - *

- * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. + * Copyright 2009-2020 the original author or authors. + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. */ package org.apache.ibatis.submitted.blocking_cache; @@ -104,42 +104,29 @@ void ensureLockIsReleasedOnRollback() { @Test void blockCacheDeathLockTest() throws InterruptedException { - CountDownLatch step = new CountDownLatch(2); - CountDownLatch waitForExecute = new CountDownLatch(2); - - new Thread(() -> { - try (SqlSession sqlSession = sqlSessionFactory.openSession()) { - PersonMapper mapper = sqlSession.getMapper(PersonMapper.class); - mapper.findById(1); - step.countDown(); - step.await(); - - mapper.findById(2); - sqlSession.commit(); - } catch (InterruptedException e) { - //ignore - } - waitForExecute.countDown(); - }).start(); - - new Thread(() -> { - try (SqlSession sqlSession = sqlSessionFactory.openSession()) { - PersonMapper mapper = sqlSession.getMapper(PersonMapper.class); - mapper.findById(2); - step.countDown(); - step.await(); - - mapper.findById(1); - sqlSession.commit(); - } catch (InterruptedException e) { - //ignore - } - waitForExecute.countDown(); - }).start(); + CountDownLatch count = new CountDownLatch(1); + Runnable run = () -> { + try (SqlSession session1 = sqlSessionFactory.openSession(); + SqlSession session2 = sqlSessionFactory.openSession()) { - boolean await = waitForExecute.await(30, TimeUnit.SECONDS); + PersonMapper mapper1 = session1.getMapper(PersonMapper.class); + PersonMapper mapper2 = session2.getMapper(PersonMapper.class); + + mapper1.findById(1); + mapper2.findById(2); + + mapper1.findById(2); + mapper2.findById(1); + + session1.commit(); + session2.commit(); + count.countDown(); + } + }; + new Thread(run).start(); + boolean await = count.await(20, TimeUnit.SECONDS); if (!await) { - throw new RuntimeException("BlockingCache has a risk of death lock!"); + throw new RuntimeException("BlockingCache made death lock"); } } } From 2dfcfb850c15ecab1248ef9db4ce2709c5cdc21f Mon Sep 17 00:00:00 2001 From: liuyueve <39432700+liuyueve@users.noreply.github.com> Date: Tue, 8 Sep 2020 12:57:29 +0800 Subject: [PATCH 08/10] Revert "BlockingCache death lock test" This reverts commit 74e3f27300cd18b95920f99e8a512f399df56478. --- .../blocking_cache/BlockingCacheTest.java | 30 ------------------- .../blocking_cache/PersonMapper.java | 3 -- 2 files changed, 33 deletions(-) diff --git a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java index 7074f3711f7..90b8fcd9023 100644 --- a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java +++ b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java @@ -16,10 +16,8 @@ package org.apache.ibatis.submitted.blocking_cache; import java.io.Reader; -import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; -import java.util.concurrent.TimeUnit; import org.apache.ibatis.BaseDataTest; import org.apache.ibatis.io.Resources; @@ -101,32 +99,4 @@ void ensureLockIsReleasedOnRollback() { mapper.findAll(); } } - - @Test - void blockCacheDeathLockTest() throws InterruptedException { - CountDownLatch count = new CountDownLatch(1); - Runnable run = () -> { - try (SqlSession session1 = sqlSessionFactory.openSession(); - SqlSession session2 = sqlSessionFactory.openSession()) { - - PersonMapper mapper1 = session1.getMapper(PersonMapper.class); - PersonMapper mapper2 = session2.getMapper(PersonMapper.class); - - mapper1.findById(1); - mapper2.findById(2); - - mapper1.findById(2); - mapper2.findById(1); - - session1.commit(); - session2.commit(); - count.countDown(); - } - }; - new Thread(run).start(); - boolean await = count.await(20, TimeUnit.SECONDS); - if (!await) { - throw new RuntimeException("BlockingCache made death lock"); - } - } } diff --git a/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java b/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java index 328ce487ed9..8449d14a074 100644 --- a/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java +++ b/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java @@ -27,9 +27,6 @@ public interface PersonMapper { @Select("select id, firstname, lastname from person") List findAll(); - @Select("select id, firstname, lastname from person where id = #{id}") - List findById(int id); - @Delete("delete from person where id = #{id}") int delete(int id); } From 23ef716370897e6bda47312f0677ebdd10b3545b Mon Sep 17 00:00:00 2001 From: liuyueve <39432700+liuyueve@users.noreply.github.com> Date: Tue, 8 Sep 2020 13:01:23 +0800 Subject: [PATCH 09/10] update test case to BlockingCache --- .../blocking_cache/BlockingCacheTest.java | 43 +++++++++++++++++++ .../blocking_cache/PersonMapper.java | 3 ++ 2 files changed, 46 insertions(+) diff --git a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java index 90b8fcd9023..c548b6a5196 100644 --- a/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java +++ b/src/test/java/org/apache/ibatis/submitted/blocking_cache/BlockingCacheTest.java @@ -16,8 +16,10 @@ package org.apache.ibatis.submitted.blocking_cache; import java.io.Reader; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; import org.apache.ibatis.BaseDataTest; import org.apache.ibatis.io.Resources; @@ -99,4 +101,45 @@ void ensureLockIsReleasedOnRollback() { mapper.findAll(); } } + + @Test + void blockCacheDeathLockTest() throws InterruptedException { + CountDownLatch step = new CountDownLatch(2); + CountDownLatch waitForExecute = new CountDownLatch(2); + + new Thread(() -> { + try (SqlSession sqlSession = sqlSessionFactory.openSession()) { + PersonMapper mapper = sqlSession.getMapper(PersonMapper.class); + mapper.findById(1); + step.countDown(); + step.await(); + + mapper.findById(2); + sqlSession.commit(); + } catch (InterruptedException e) { + //ignore + } + waitForExecute.countDown(); + }).start(); + + new Thread(() -> { + try (SqlSession sqlSession = sqlSessionFactory.openSession()) { + PersonMapper mapper = sqlSession.getMapper(PersonMapper.class); + mapper.findById(2); + step.countDown(); + step.await(); + + mapper.findById(1); + sqlSession.commit(); + } catch (InterruptedException e) { + //ignore + } + waitForExecute.countDown(); + }).start(); + + boolean await = waitForExecute.await(30, TimeUnit.SECONDS); + if (!await) { + throw new RuntimeException("BlockingCache has a risk of death lock!"); + } + } } diff --git a/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java b/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java index 8449d14a074..ac5ad2dc595 100644 --- a/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java +++ b/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java @@ -27,6 +27,9 @@ public interface PersonMapper { @Select("select id, firstname, lastname from person") List findAll(); + @Select("select id, firstname, lastname from person") + List findById(int id); + @Delete("delete from person where id = #{id}") int delete(int id); } From 709d416ae725a21f63ad7f9f4afd917504a13481 Mon Sep 17 00:00:00 2001 From: liuyueve <39432700+liuyueve@users.noreply.github.com> Date: Tue, 8 Sep 2020 13:03:03 +0800 Subject: [PATCH 10/10] update test case --- .../apache/ibatis/submitted/blocking_cache/PersonMapper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java b/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java index ac5ad2dc595..328ce487ed9 100644 --- a/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java +++ b/src/test/java/org/apache/ibatis/submitted/blocking_cache/PersonMapper.java @@ -27,7 +27,7 @@ public interface PersonMapper { @Select("select id, firstname, lastname from person") List findAll(); - @Select("select id, firstname, lastname from person") + @Select("select id, firstname, lastname from person where id = #{id}") List findById(int id); @Delete("delete from person where id = #{id}")