[
http://jira.jboss.com/jira/browse/JBCACHE-1250?page=comments#action_12393343 ]
Brian Stansberry commented on JBCACHE-1250:
-------------------------------------------
The use case is Hibernate caching evictAll() or removeAll() operations. These happen, for
example, when Hibernate detects it's executed an SQL update that effects multiple
unknown entities; i.e. user directly executes SQL. I have a structural node, which I want
to keep, but I need to atomically remove all children, including any children on remote
nodes that I may not know about. 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.
I've got semi-clunky workarounds for properly restoring the structural node, but this
proposal seems a nice way to do it cleanly.
In terms of urgency, it involves changing API, so shouldn't be before 3.0.0. And
I've got a workaround that should work.
Add a Node.clearChildren() functionality
----------------------------------------
Key: JBCACHE-1250
URL:
http://jira.jboss.com/jira/browse/JBCACHE-1250
Project: JBoss Cache
Issue Type: Feature Request
Security Level: Public(Everyone can see)
Reporter: Brian Stansberry
Assigned To: Manik Surtani
Fix For: 3.0.0
For next major API change.
Equivalent to Node.clearData(), but removes the children.
Use case is trying to atomically remove everything under some structural node, while
leaving the structural node in place. The best that can be done now is either:
1) Remove the node and re-add it, but this doesn't work for remote caches with
INVALIDATION, since both the removal and the addition propagate as invalidation messages.
Remote caches are left w/o the structural node. Plus it's not atomic.
2) Query for the children and remove them one by one. Also not atomic, plus if
lockParentForChildInsertRemove is false you have to deal with other threads possibly
adding new children while you are removing.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira