[Clustering/JBoss] - Re: ConcurrentModificationException during session serializa
by smarlow@redhat.com
What I mean, is should SessionBasedClusteredSession.writeExternal + SessionBasedClusteredSession.readExternal instead synchronize on getSession(), which should be the same StandardSessionFacade as RichFaces is synchronizing on.
I haven't recreated the bug yet. I could either recreate it or you could try the following SessionBasedClusteredSession change (two line change to synchronize on common session facade) :
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException
| {
| synchronized (getSession()) // change 1 of 2
| {
| // Let superclass read in everything but the attribute map
| super.readExternal(in);
|
| attributes = (Map) in.readObject();
| }
| }
|
| public void writeExternal(ObjectOutput out) throws IOException
| {
| synchronized (getSession) // change 2 of 2
| {
| // Let superclass write out everything but the attribute map
| super.writeExternal(out);
|
| // Don't replicate any excluded attributes
| Map excluded = removeExcludedAttributes(attributes);
|
| out.writeObject(attributes);
|
| // Restore any excluded attributes
| if (excluded != null)
| attributes.putAll(excluded);
| }
|
| }
|
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4239792#4239792
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4239792
16 years, 10 months
[JBoss Cache: Core Edition] - Re: node.getChild() returning inconsistent results
by drcallaway
"galder.zamarreno(a)jboss.com" wrote : getChild() takes the fqn of the child, it's a relative method. Root already provides the first /, so the name of the child is without that first /: content/timestamp
|
| If u used Cache rather than Node, you'd do the following using the absolute path:
| cache.getNode("/content/timestamp");
Thanks Galder. That makes sense but I'm having trouble reconciling your comments with this code right out of the JBoss Cache Users' Guide:
| // Let's get a hold of the root node.
| Node rootNode = cache.getRoot();
|
| // Remember, JBoss Cache stores data in a tree structure.
| // All nodes in the tree structure are identified by Fqn objects.
| Fqn peterGriffinFqn = Fqn.fromString("/griffin/peter");
|
| // Create a new Node
| Node peterGriffin = rootNode.addChild(peterGriffinFqn);
|
This code uses an absolute value FQN to retrieve a node directly from the root node (not from cache). Perhaps the Users' Guide is incorrect?
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4239789#4239789
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4239789
16 years, 10 months