This discussion relates to
https://jira.jboss.org/jira/browse/JBCACHE-1250 as well
Quoting myself from my first comment on that JIRA:
"Main reason I want to keep the structural node around are 1) it's marked as
"resident" and 2) if OPTIMISTIC it has a special DataVersion that never reports
conflicts. Without that DataVersion I get OL conflicts. If I let the structural node get
reestablished via a regular put for a child, it ends up with regular data version."
Re: 2)
The discussion above may remove the DataVersion issue. The DataVersionProvider interface
allows me to ensure the correct DataVersion is applied to the resident node. I say
"may" because it only solves the problem if the DataVersion is properly passed
around the cluster, works with invalidation etc. Haven't thought hard about that.
Further, looking at the analysis of data versions on this thread, I think what is really
needed for the Hibernate case is to disable the data versioning for OL. That is, allow
configuration of a cache-wide DataVersionFactory, where Hibernate would configure a
factory that returns its NonLockingDataVersion. There doesn't seem to be any
advantage to actually doing version validation. Either Hibernate will catch any version
conflict at the DB level before the JBC beforeCompletion() callback gets invoked, or a
PFER will see any existing node and abort.
Re: 1)
TBH, I'm not sure if there's any reason I care about the node being marked
"resident" other than its relation to the DataVersion issue. IIRC
"resident" basically means it doesn't get evicted, and I *think* the only
reason I care about eviction is I lose the custom DataVersion. But let's assume I do
have a reason to care, or someone else does. Perhaps the DataVersionProvider concept
discussed above should be expanded to handle all such "NodeMetaData":
| public interface NodeMetaDataProvider() {
|
| NodeMetaData getNodeMetaData(Fqn fqn);
|
| }
|
| public interface NodeMetaData {
|
| /** Get the desired DataVersion for the node. A return value of null means use the
default mechanism for determining the DataVersion */
| DataVersion getDataVersion();
|
| /** Should the node be marked as resident? */
| boolean isResident();
|
| .... for any similar metadata
| }
|
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4168170#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...