Skip to content

Commit 4b3a655

Browse files
committed
HHH-9804 Ehcache integration uses a write lock where a read lock is requested in EhcacheTransactionalDataRegion
1 parent 7308e14 commit 4b3a655

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

hibernate-ehcache/src/main/java/org/hibernate/cache/ehcache/internal/regions/EhcacheTransactionalDataRegion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public final void writeUnlock(Object key) throws CacheException {
263263
*/
264264
public final void readLock(Object key) throws CacheException {
265265
try {
266-
lockProvider.getSyncForKey( key ).lock( LockType.WRITE );
266+
lockProvider.getSyncForKey( key ).lock( LockType.READ );
267267
}
268268
catch (net.sf.ehcache.CacheException e) {
269269
if ( e instanceof NonStopCacheException ) {
@@ -285,7 +285,7 @@ public final void readLock(Object key) throws CacheException {
285285
*/
286286
public final void readUnlock(Object key) throws CacheException {
287287
try {
288-
lockProvider.getSyncForKey( key ).unlock( LockType.WRITE );
288+
lockProvider.getSyncForKey( key ).unlock( LockType.READ );
289289
}
290290
catch (net.sf.ehcache.CacheException e) {
291291
if ( e instanceof NonStopCacheException ) {

0 commit comments

Comments
 (0)