Uploaded image for project: 'JBoss Cache'
  1. JBoss Cache
  2. JBCACHE-1026

Concurrent creation of nodes fails with optimistic locking, even if nodes are empty and contain no data.

    Details

    • Workaround:
      Workaround Exists
    • Workaround Description:
      Hide

      Create the parent node under which you expect concurret creates before your app starts.

      Show
      Create the parent node under which you expect concurret creates before your app starts.
    • Estimated Difficulty:
      Low

      Description

      Create /parent/child1 and /parent/child2 concurrently. This is a race condition where when trying to validate the 2 txs, both txs have /parent marked as "created" in their workspace. When tx1 commits, this succeeds. When tx2 tries to commit, ths fails validation since /parent exists in the tree even though it is marked as created in tx2's workspace.

      This manifests itself in exceptions such as

      org.jboss.cache.optimistic.DataVersioningException: Tx attempted to create /parent anew. It has already been created since this tx started by another (possibly remote) tx.

      Now this is VALID behaviour since we shouldn't attempt to create /parent twice, but as an optimisation, it should be allowed to succeed IF when tx2 attempts to validate, the node exists in the tree AND doesn't contain any data or the node does not exist in the workspace.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Assignee:
                manik Manik Surtani
                Reporter:
                manik Manik Surtani
              • Votes:
                0 Vote for this issue
                Watchers:
                0 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: