Small fixes of handling record operations in storage
@@ -4008,16 +4008,8 @@ public abstract class OAbstractPaginatedStorage extends OStorageAbstract
return new OStorageOperationResult<>(ppos);
} catch (IOException ioe) {
- try {
- if (ppos.clusterPosition != ORID.CLUSTER_POS_INVALID)
- cluster.deleteRecord(ppos.clusterPosition);
- } catch (IOException e) {
- OLogManager.instance().error(this, "Error on creating record in cluster: " + cluster, e);
- }
-
- OLogManager.instance().error(this, "Error on creating record in cluster: " + cluster, ioe);
-
- throw OException.wrapException(new OStorageException("Error during record deletion"), ioe);
+ throw OException.wrapException(
+ new OStorageException("Error during record deletion in cluster " + (cluster != null ? cluster.getName() : "")), ioe);
}
}
@@ -4101,13 +4093,8 @@ public abstract class OAbstractPaginatedStorage extends OStorageAbstract
recordConflict.incrementAndGet();
throw e;
} catch (IOException ioe) {
- OLogManager.instance().error(this, "Error on updating record " + rid + " (cluster: " + cluster + ")", ioe);
-
- final int recordVersion = -1;
- if (callback != null)
- callback.call(rid, recordVersion);
-
- return new OStorageOperationResult<>(recordVersion);
+ throw OException
+ .wrapException(new OStorageException("Error on updating record " + rid + " (cluster: " + cluster.getName() + ")"), ioe);
}
}
@@ -4192,8 +4179,8 @@ public abstract class OAbstractPaginatedStorage extends OStorageAbstract
return new OStorageOperationResult<>(true);
} catch (IOException ioe) {
- OLogManager.instance().error(this, "Error on deleting record " + rid + "( cluster: " + cluster + ")", ioe);
- throw OException.wrapException(new OStorageException("Error on deleting record " + rid + "( cluster: " + cluster + ")"), ioe);
+ throw OException
+ .wrapException(new OStorageException("Error on deleting record " + rid + "( cluster: " + cluster.getName() + ")"), ioe);
}
}
