Commit 2f578537 authored by Andre Freyssinet's avatar Andre Freyssinet

Fix JMQ-215.

parent 8ed07f7e
/*
* Copyright (C) 2009 - 2019 ScalAgent Distributed Technologies
* Copyright (C) 2009 - 2021 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -385,6 +385,11 @@ public final class NGTransaction extends AbstractTransaction implements NGTransa
else
op = Operation.alloc(Operation.SAVE, dirName, name, buf);
Operation old = (Operation) log.put(key, op);
// Bug fix: JMQ-215
if (first && (old != null) && (old.type == Operation.DELETE))
op.type = Operation.SAVE;
if (copy) {
if ((old != null) &&
(old.type == Operation.SAVE) &&
......
/*
* Copyright (C) 2006 - 2020 ScalAgent Distributed Technologies
* Copyright (C) 2006 - 2021 ScalAgent Distributed Technologies
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
......@@ -365,6 +365,11 @@ public abstract class DBTransaction extends AbstractTransaction implements DBTra
else
op = DBOperation.alloc(Operation.SAVE, fname, buf);
DBOperation old = (DBOperation) log.put(fname, op);
// Bug fix: JMQ-215
if (first && (old != null) && (old.type == Operation.DELETE))
op.type = Operation.SAVE;
if (copy) {
if ((old != null) &&
(old.type == DBOperation.SAVE) &&
......@@ -514,6 +519,7 @@ public abstract class DBTransaction extends AbstractTransaction implements DBTra
lastTry = System.currentTimeMillis();
connectDB();
createPreparedStatement();
logmon.log(BasicLevel.DEBUG, "DBTransaction, commit: DB connected");
} catch (IOException exc) {
logmon.log(BasicLevel.INFO, "DBTransaction, commit: cannot reconnect" + exc.getMessage());
}
......
......@@ -490,6 +490,11 @@ public final class NTransaction extends AbstractTransaction implements NTransact
else
op = Operation.alloc(Operation.SAVE, dirName, name, buf);
Operation old = (Operation) log.put(key, op);
// Bug fix: JMQ-215
if (first && (old != null) && (old.type == Operation.DELETE))
op.type = Operation.SAVE;
if (copy) {
if ((old != null) &&
(old.type == Operation.SAVE) &&
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment