|
|
@ -19,7 +19,6 @@ import org.hibernate.cache.CacheException;
|
|
|
|
import org.hibernate.cache.spi.*;
|
|
|
|
import org.hibernate.cache.spi.*;
|
|
|
|
import org.hibernate.cache.spi.access.AccessType;
|
|
|
|
import org.hibernate.cache.spi.access.AccessType;
|
|
|
|
import org.hibernate.cfg.Settings;
|
|
|
|
import org.hibernate.cfg.Settings;
|
|
|
|
import org.hibernate.internal.util.StringHelper;
|
|
|
|
|
|
|
|
import org.hibernate.internal.util.config.ConfigurationHelper;
|
|
|
|
import org.hibernate.internal.util.config.ConfigurationHelper;
|
|
|
|
import org.jboss.logging.Logger;
|
|
|
|
import org.jboss.logging.Logger;
|
|
|
|
import org.redisson.Redisson;
|
|
|
|
import org.redisson.Redisson;
|
|
|
@ -169,7 +168,7 @@ public class RedissonRegionFactory implements RegionFactory {
|
|
|
|
+ "local nextValue = math.max(tonumber(ARGV[1]), tonumber(currentTime) + 1); "
|
|
|
|
+ "local nextValue = math.max(tonumber(ARGV[1]), tonumber(currentTime) + 1); "
|
|
|
|
+ "redis.call('set', KEYS[1], nextValue); "
|
|
|
|
+ "redis.call('set', KEYS[1], nextValue); "
|
|
|
|
+ "return nextValue;",
|
|
|
|
+ "return nextValue;",
|
|
|
|
RScript.ReturnType.INTEGER, Collections.singletonList(qualifyName("redisson-hibernate-timestamp")), time);
|
|
|
|
RScript.ReturnType.INTEGER, Collections.singletonList("redisson-hibernate-timestamp"), time);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
if (fallback) {
|
|
|
|
if (fallback) {
|
|
|
|
while (true) {
|
|
|
|
while (true) {
|
|
|
@ -190,14 +189,6 @@ public class RedissonRegionFactory implements RegionFactory {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
private String qualifyName(String name) {
|
|
|
|
|
|
|
|
String prefix = settings.getCacheRegionPrefix();
|
|
|
|
|
|
|
|
if (StringHelper.isEmpty(prefix)) {
|
|
|
|
|
|
|
|
return name;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return prefix + "." + name;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata)
|
|
|
|
public EntityRegion buildEntityRegion(String regionName, Properties properties, CacheDataDescription metadata)
|
|
|
|
throws CacheException {
|
|
|
|
throws CacheException {
|
|
|
|