Closed enozcan closed 4 years ago
The related issue is #62.
When deferred-write is enabled, the problem occurs in the following scenario:
deferred-write
HazelcastHttpSession#getAttribute(some_attr)
non-transient
HazelcastHttpSession#setAttribute(some_attr)
dirty
HazelcastHttpSession#sessionDeferredWrite
dirty && !transient
This is not the case when deferred-write = false.
deferred-write = false
If deferred-write is disabled, the following check prevents the entry to be stored in the distributed map since transient flag is properly set in the method: https://github.com/hazelcast/hazelcast-wm/blob/c25e35ac06fe18f43323782238005b9944f4ed53/src/main/java/com/hazelcast/web/HazelcastHttpSession.java#L97
transient
The related issue is #62.
When
deferred-write
is enabled, the problem occurs in the following scenario:HazelcastHttpSession#getAttribute(some_attr)
creates a local cache entry with null value. This entry is marked asnon-transient
regardless of it is transient entry or not. https://github.com/hazelcast/hazelcast-wm/blob/c25e35ac06fe18f43323782238005b9944f4ed53/src/main/java/com/hazelcast/web/HazelcastHttpSession.java#L116HazelcastHttpSession#setAttribute(some_attr)
marks this entry asdirty
and at the end of the request,HazelcastHttpSession#sessionDeferredWrite
method writes this attribute to distributed map since beingdirty && !transient
This is not the case when
deferred-write = false
.If
deferred-write
is disabled, the following check prevents the entry to be stored in the distributed map sincetransient
flag is properly set in the method: https://github.com/hazelcast/hazelcast-wm/blob/c25e35ac06fe18f43323782238005b9944f4ed53/src/main/java/com/hazelcast/web/HazelcastHttpSession.java#L97