[jboss-user] [JBoss Cache Users] - Locking parent nodes even with lockParentForChildInsertRemov
do-not-reply at jboss.com
Mon Oct 5 07:24:13 EDT 2009
To stress test my JBossCache instance (3.2.0 GA, local mode, synchronous JDBCCacheLoader), I've designed a multi-threaded application which inserts numerous nodes under a common root, e.g. /a/b/c/1, /a/b/c/2, /a/b/c/3, etc. The cache is configured NOT to lock parents for child insert/remove, still, I occasionally get TimeoutExceptions while trying to lock one of the parent nodes, such as a or b, with the MVCCNodeHelper.wrapNodeForWriting being blamed in the stack trace.
Digging into the JBoss Cache sources, I've found out that MVCCNodeHelper.wrapNodeForWriting is being called recursively, and although lockForWriting parameter is false for parent nodes, they still get write-locked, I assume - because they don't exist in the current InvocationContext and are 'createdIfAbsent' - which in turn locks their Fqn's for writing until they're fetched from the DataContainer.
To make long story short, this seems to me like the lockParentForChildInsertRemove = false setting is not effective in my case - parents get locked for writing anyway. Might it be by design? Has anybody stumbled upon this? Or should MVCCNodeHelper.wrapNodeForWriting delegate the recursive call for parent node to wrapNodeForReading (instead of wrapNodeForWriting) if lockParent = false and parent is not in the InvocationContext?
Any help greatly appreciated,
View the original post : http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4258622#4258622
Reply to the post : http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=4258622
More information about the jboss-user