Arik Hadas has uploaded a new change for review. Change subject: core: remove redundant transactions ......................................................................
core: remove redundant transactions Change-Id: I717a7596cb2cbe441a96b87d1475635fc0840273 Signed-off-by: Arik Hadas <[email protected]> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandsCacheImpl.java 1 file changed, 4 insertions(+), 32 deletions(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/29/28929/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandsCacheImpl.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandsCacheImpl.java index c278a66..42485b2 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandsCacheImpl.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/tasks/CommandsCacheImpl.java @@ -52,28 +52,13 @@ @Override public void remove(final Guid commandId) { commandMap.remove(commandId); - TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Object>() { - - @Override - public Void runInTransaction() { - DbFacade.getInstance().getCommandEntityDao().remove(commandId); - return null; - } - }); - + DbFacade.getInstance().getCommandEntityDao().remove(commandId); } @Override public void put(final CommandEntity cmdEntity) { commandMap.put(cmdEntity.getId(), cmdEntity); - TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Object>() { - - @Override - public Void runInTransaction() { - DbFacade.getInstance().getCommandEntityDao().saveOrUpdate(cmdEntity); - return null; - } - }); + DbFacade.getInstance().getCommandEntityDao().saveOrUpdate(cmdEntity); } public void removeAllCommandsBeforeDate(DateTime cutoff) { @@ -87,14 +72,7 @@ if (cmdEntity != null) { cmdEntity.setCommandStatus(status); if (taskType.equals(AsyncTaskType.notSupported) || cmdEntity.isCallBackEnabled()) { - TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Object>() { - - @Override - public Void runInTransaction() { - DbFacade.getInstance().getCommandEntityDao().saveOrUpdate(cmdEntity); - return null; - } - }); + DbFacade.getInstance().getCommandEntityDao().saveOrUpdate(cmdEntity); } } } @@ -104,13 +82,7 @@ CommandEntity cmdEntity = get(commandId); if (cmdEntity != null) { cmdEntity.setCallBackNotified(true); - TransactionSupport.executeInScope(TransactionScopeOption.Required, new TransactionMethod<Void>() { - @Override - public Void runInTransaction() { - DbFacade.getInstance().getCommandEntityDao().updateNotified(commandId); - return null; - } - }); + DbFacade.getInstance().getCommandEntityDao().updateNotified(commandId); } } } -- To view, visit http://gerrit.ovirt.org/28929 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I717a7596cb2cbe441a96b87d1475635fc0840273 Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Arik Hadas <[email protected]> _______________________________________________ Engine-patches mailing list [email protected] http://lists.ovirt.org/mailman/listinfo/engine-patches
