Skip to content

Commit

Permalink
HttpSession clustering sticky session doc.
Browse files Browse the repository at this point in the history
  • Loading branch information
mdogan committed Apr 10, 2012
1 parent 22a8abb commit 3d9057c
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@
<param-value>true</param-value>
</init-param>
</filter>
]]></programlisting>

<programlisting language="xml"><![CDATA[
<filter-mapping>
<filter-name>hazelcast-filter</filter-name>
<url-pattern>/*</url-pattern>
Expand All @@ -149,4 +152,33 @@
and it will put the
session objects into Hazelcast distributed map if needed.

<para>
<emphasis role="bold">Info about sticky-sessions:</emphasis>
Hazelcast holds whole session attributes in a distributed map and in local http session. Local session is required
for fast access to data and distributed map is needed for fail-safety.
<itemizedlist>
<listitem>
<para>
<emphasis role="italic">If sticky-session is not used, whenever a session a attribute
is updated in a node (in both node local session and clustered cache),
that attribute should be invalidated in all other nodes' local sessions,
because now they have dirty value. So when a request arrives one of those other nodes
that attribute value is fetched from clustered cache.</emphasis>
</para>
</listitem>

<listitem>
<para>
<emphasis role="italic">To overcome performance penalty of sending invalidation messages during updates,
sticky-sessions can be used.
If Hazelcast knows sessions are sticky, invalidation will not be send, because Hazelcast assumes there is
no other local session at the moment. When a server is down, requests belonging to a session hold
in that server will routed to other one and that server will fetch session data from clustered cache.
That means using sticky-sessions, one will not suffer performance penalty of accessing clustered data
and can benefit recover from a server failure.</emphasis>
</para>
</listitem>
</itemizedlist>
</para>

</para>
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,7 @@ public void commitMap() {

public void commitQueue() {
if (!removed) {
offerAgain();
factory.node.blockingQueueManager.offerCommit(name, key, value);
}
}

Expand All @@ -451,10 +451,6 @@ public void rollbackQueue() {
}
}

private void offerAgain() {
factory.node.blockingQueueManager.offerCommit(name, key, value);
}

@Override
public String toString() {
return "TransactionRecord{" +
Expand Down

0 comments on commit 3d9057c

Please sign in to comment.