You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
MyBatis gets a ReadWriteLock from the cache provider and calls read.lock() and write.lock() when calling getObject() and putObject().
The default cache provides its own Synchronized decorator that makes sure that accesses to cache are properly synchronized. So in this case we are doing two locks and only one is needed.
In the case of 3rd party cache providers like Hazelcast, EhCache... they already provide sharper locking and do not need any extra external locking.
This change may affect those that have implemented or extended the MyBatis default cache.
From now over Cache implementors can just return null in getReadWriteLock method.
The text was updated successfully, but these errors were encountered:
MyBatis gets a ReadWriteLock from the cache provider and calls read.lock() and write.lock() when calling getObject() and putObject().
The default cache provides its own Synchronized decorator that makes sure that accesses to cache are properly synchronized. So in this case we are doing two locks and only one is needed.
In the case of 3rd party cache providers like Hazelcast, EhCache... they already provide sharper locking and do not need any extra external locking.
This change may affect those that have implemented or extended the MyBatis default cache.
From now over Cache implementors can just return null in getReadWriteLock method.
The text was updated successfully, but these errors were encountered: