Michael Kublin has uploaded a new change for review. Change subject: engine: War aginst long transaction - migration of vms ......................................................................
engine: War aginst long transaction - migration of vms In engine commonly used anti-design pattern - long transaction. The reason is by default all actions are opening transaction, even no DB operation is performed. Because of to remove something is much more difficult than to add (I think because of psychological reason) , I am not disabling a global transcation for all commands, but marking single command with @NonTransactiveCommandAttribute. So as a result on of the following results will be achieved: 1. All command will be marked by @NonTransactiveCommandAttribute annottation and after that a global transaction will be removed and all annotattion also 2. I will become bored because of this ant work Now , why I am removing transaction here : because only one DB operation is perfromed and for second operation a new transaction is open (sic!) Change-Id: I40f16b5dea308ebd3e3129866f60bb01352d53d5 Signed-off-by: Michael Kublin <mkub...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InternalMigrateVmCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java 3 files changed, 3 insertions(+), 0 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/03/13103/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InternalMigrateVmCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InternalMigrateVmCommand.java index 9ce0972..51acd4e 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InternalMigrateVmCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/InternalMigrateVmCommand.java @@ -6,6 +6,7 @@ import org.ovirt.engine.core.compat.Guid; import org.ovirt.engine.core.dal.VdcBllMessages; +@NonTransactiveCommandAttribute @InternalCommandAttribute public class InternalMigrateVmCommand<T extends InternalMigrateVmParameters> extends MigrateVmCommand<MigrateVmParameters> { diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java index 45ea7c4..cd47ad7 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmCommand.java @@ -24,6 +24,7 @@ import org.ovirt.engine.core.dal.dbbroker.auditloghandling.CustomLogField; import org.ovirt.engine.core.dal.dbbroker.auditloghandling.CustomLogFields; +@NonTransactiveCommandAttribute @CustomLogFields({ @CustomLogField("VdsDestination"), @CustomLogField("DueToMigrationError") }) public class MigrateVmCommand<T extends MigrateVmParameters> extends RunVmCommandBase<T> { diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java index 723b51d..e5e8869 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/MigrateVmToServerCommand.java @@ -7,6 +7,7 @@ import org.ovirt.engine.core.dal.VdcBllMessages; import org.ovirt.engine.core.dal.dbbroker.DbFacade; +@NonTransactiveCommandAttribute public class MigrateVmToServerCommand<T extends MigrateVmToServerParameters> extends MigrateVmCommand<T> { public MigrateVmToServerCommand(T parameters) { super(parameters); -- To view, visit http://gerrit.ovirt.org/13103 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I40f16b5dea308ebd3e3129866f60bb01352d53d5 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Michael Kublin <mkub...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches