Bug report?

  • When I create a BlockingCache and try to putObject, I get an error IllegalStateException("Detected an attempt at releasing unacquired lock. This should never happen."); which is caused by the empty lock when releaseLock

To fix a bug, we need to reproduce it first. And we spend a lot of time just trying to reproduce the reported problem, so please consider creating a failing test case or an example project.

  • How to create a test case : https://github.com/mybatis/mybatis-3/wiki/Unit-Test
  • How to create a good example : http://sscce.org
  • How to upload your project to GitHub: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

Feature request?

  • Please delete the BUG REPORT FORM below and describe the feature.
  • It is a good idea to discuss your changes on the mailing list to get feedback from the community. https://groups.google.com/group/mybatis-user
  • If you have a patch with unit tests, send a pull request. Please see the wiki page : https://github.com/mybatis/mybatis-3/wiki/Contribute -->

MyBatis version

3.5.17

Database vendor and version

Test case or example project

Steps to reproduce

Expected result

Actual result

Comment From: harawata

Hello @lingyufei ,

BlockingCache (or any of MyBatis' internal cache classes) is not designed to be used in users' code directly. So, it is not a bug if that is what you are trying to do.

If the exception is thrown in MyBatis' normal usage scenario, we need you to provide an executable demo project or test case. Here are some project templates and examples : https://github.com/harawata/mybatis-issues There also are some unit tests for blocking cache in this directory.