From 26973bfdb138ebbe760005ee1fc07c28781d4fdb Mon Sep 17 00:00:00 2001
From: Jean-Noel Rouvignac <jean-noel.rouvignac@forgerock.com>
Date: Tue, 23 Dec 2014 11:18:12 +0000
Subject: [PATCH] PersistItStorage.java: Removed FIXME because now we know there is actually nothing to fix :)
---
opendj-sdk/opendj3-server-dev/src/server/org/opends/server/backends/persistit/PersistItStorage.java | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/opendj-sdk/opendj3-server-dev/src/server/org/opends/server/backends/persistit/PersistItStorage.java b/opendj-sdk/opendj3-server-dev/src/server/org/opends/server/backends/persistit/PersistItStorage.java
index a597865..a1b7452 100644
--- a/opendj-sdk/opendj3-server-dev/src/server/org/opends/server/backends/persistit/PersistItStorage.java
+++ b/opendj-sdk/opendj3-server-dev/src/server/org/opends/server/backends/persistit/PersistItStorage.java
@@ -25,7 +25,7 @@
*/
package org.opends.server.backends.persistit;
-import static org.opends.server.util.StaticUtils.getFileForPath;
+import static org.opends.server.util.StaticUtils.*;
import java.io.File;
import java.util.HashMap;
@@ -73,10 +73,7 @@
@Override
public void close()
{
- /*
- * Release immediately because this exchange did not come from the txn
- * cache.
- */
+ // Release immediately because this exchange did not come from the txn cache
db.releaseExchange(ex);
}
@@ -340,11 +337,13 @@
{
try
{
+ // There is no CAS (Compare And Swap) operation to do here :)
+ // Following code is fine because Persistit provides snapshot isolation.
+ // If another thread tries to update the same key, we'll get a RollbackException
+ // And the write operation will be retried (see write() method in this class)
final Exchange ex = getExchange(treeName);
bytesToKey(ex.getKey(), key);
ex.fetch();
- // FIXME poor man's CAS: this will not work under high volume,
- // but PersistIt does not provide APIs for this use case.
final Value exValue = ex.getValue();
if (exValue.isDefined())
{
--
Gitblit v1.10.0