Paul Ferraro created WFLY-11924:
-----------------------------------
Summary: Add ability to group distributed session attributes to avoid cost of
SESSION granularity
Key: WFLY-11924
URL:
https://issues.jboss.org/browse/WFLY-11924
Project: WildFly
Issue Type: Feature Request
Components: Clustering
Affects Versions: 16.0.0.Final
Reporter: Paul Ferraro
Assignee: Paul Ferraro
Since SESSION granularity requires the replication of *all* session attribute if *any*
attribute was modified in a given request, most distributed web applications should
leverage ATTRIBUTE granularity whenever to possible to reduce the replication payload
costs per request.
However, if session attribute contains any reference to another session attribute, they
are forced to use SESSION granularity to avoid losing referential integrity on failover
and duplication of serialized data.
The proposal is to allow users the ability to annotate their session attribute classes
such that they can group specific attribute together, while still being able to leverage
ATTRIBUTE granularity for the remainder of their session attributes.
From the user's perspective, I envision something like this:
{code:java}
@SessionAttributeGroup("order")
public class Order implements Serializable {
List<OrderItem> items;
}
@SessionAttributeGroup("order")
public class OrderItem implements Serializable {
//...
}
{code}
Thus the code:
{code:java}
session.setAttribute("order", order);
session.setAttribute("customized-item", item);
{code}
will result in both attributes being store within a single cache entry.
Internally, we use the @SessionAttributeGroup as the attribute name, and a Map<String,
Object> as the attribute value, keyed by the actual attribute name.
--
This message was sent by Atlassian Jira
(v7.12.1#712002)