diff --git a/spring-session-hazelcast/hazelcast4/src/integration-test/java/org/springframework/session/hazelcast/SessionEventHazelcast4IndexedSessionRepositoryTests.java b/spring-session-hazelcast/hazelcast4/src/integration-test/java/org/springframework/session/hazelcast/SessionEventHazelcast4IndexedSessionRepositoryTests.java index ab293e99..087ab814 100644 --- a/spring-session-hazelcast/hazelcast4/src/integration-test/java/org/springframework/session/hazelcast/SessionEventHazelcast4IndexedSessionRepositoryTests.java +++ b/spring-session-hazelcast/hazelcast4/src/integration-test/java/org/springframework/session/hazelcast/SessionEventHazelcast4IndexedSessionRepositoryTests.java @@ -21,7 +21,6 @@ import java.time.Instant; import com.hazelcast.core.HazelcastInstance; import org.junit.jupiter.api.BeforeEach; -import org.junit.jupiter.api.Disabled; import org.junit.jupiter.api.Test; import org.junit.jupiter.api.extension.ExtendWith; @@ -179,7 +178,6 @@ class SessionEventHazelcast4IndexedSessionRepositoryTests { } @Test // gh-1300 - @Disabled("See https://github.com/hazelcast/hazelcast/issues/16987") void updateMaxInactiveIntervalTest() throws InterruptedException { S sessionToSave = this.repository.createSession(); sessionToSave.setMaxInactiveInterval(Duration.ofMinutes(30)); diff --git a/spring-session-hazelcast/hazelcast4/src/main/java/org/springframework/session/hazelcast/Hazelcast4SessionUpdateEntryProcessor.java b/spring-session-hazelcast/hazelcast4/src/main/java/org/springframework/session/hazelcast/Hazelcast4SessionUpdateEntryProcessor.java index 0dfec35e..947d9be8 100644 --- a/spring-session-hazelcast/hazelcast4/src/main/java/org/springframework/session/hazelcast/Hazelcast4SessionUpdateEntryProcessor.java +++ b/spring-session-hazelcast/hazelcast4/src/main/java/org/springframework/session/hazelcast/Hazelcast4SessionUpdateEntryProcessor.java @@ -19,9 +19,10 @@ package org.springframework.session.hazelcast; import java.time.Duration; import java.time.Instant; import java.util.Map; +import java.util.concurrent.TimeUnit; -import com.hazelcast.core.Offloadable; import com.hazelcast.map.EntryProcessor; +import com.hazelcast.map.ExtendedMapEntry; import org.springframework.session.MapSession; @@ -32,7 +33,7 @@ import org.springframework.session.MapSession; * @author Eleftheria Stein * @since 2.4.0 */ -public class Hazelcast4SessionUpdateEntryProcessor implements EntryProcessor, Offloadable { +public class Hazelcast4SessionUpdateEntryProcessor implements EntryProcessor { private Instant lastAccessedTime; @@ -62,15 +63,16 @@ public class Hazelcast4SessionUpdateEntryProcessor implements EntryProcessor) entry).setValue(value, this.maxInactiveInterval.getSeconds(), + TimeUnit.SECONDS); + } + else { + entry.setValue(value); + } return Boolean.TRUE; } - @Override - public String getExecutorName() { - return OFFLOADABLE_EXECUTOR; - } - void setLastAccessedTime(Instant lastAccessedTime) { this.lastAccessedTime = lastAccessedTime; }