Michael Kublin has posted comments on this change.

Change subject: core: fix redundant storage server conn in db
......................................................................


Patch Set 4: (5 inline comments)

....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/DisconnectStorageServerConnectionCommand.java
Line 37:         }
Line 38: 
Line 39:         return returnValue;
Line 40:     }
Line 41: 
This method usually will return true, in case of failure exception will be 
thrown
Line 42:     protected boolean disconnectStorage() {
Line 43:         return Backend.getInstance()
Line 44:                .getResourceManager()
Line 45:                .RunVdsCommand(


Line 39:         return returnValue;
Line 40:     }
Line 41: 
Line 42:     protected boolean disconnectStorage() {
Line 43:         return Backend.getInstance()
we have runVdsCommand()
Line 44:                .getResourceManager()
Line 45:                .RunVdsCommand(
Line 46:                     VDSCommandType.DisconnectStorageServer,
Line 47:                         new 
ConnectStorageServerVDSCommandParameters(getParameters().getVdsId(), 
getParameters()


....................................................
File 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/storage/RemoveStorageServerConnectionCommand.java
Line 5: import org.ovirt.engine.core.bll.NonTransactiveCommandAttribute;
Line 6: import 
org.ovirt.engine.core.common.action.StorageServerConnectionParametersBase;
Line 7: 
Line 8: @NonTransactiveCommandAttribute
Line 9: @InternalCommandAttribute
Repeating again, @InternalCommandAttribute should be removed
Line 10: public class RemoveStorageServerConnectionCommand<T extends 
StorageServerConnectionParametersBase> extends 
DisconnectStorageServerConnectionCommand {
Line 11: 
Line 12:     public RemoveStorageServerConnectionCommand(T parameters) {
Line 13:         super(parameters);


Line 14:     }
Line 15: 
Line 16:     @Override
Line 17:     protected void executeCommand() {
Line 18:        //disconnect the connection from vdsm
This is usually true, otherwise exception is thrown
Line 19:        boolean isStorageDisconnectSucceeded = disconnectStorage();
Line 20: 
Line 21:        if(isStorageDisconnectSucceeded) {
Line 22:              String connectionId = getConnection().getid();


Line 22:              String connectionId = getConnection().getid();
Line 23:              if(StringUtils.isNotEmpty(connectionId)) {
Line 24:                  //remove the connection record from db
Line 25:                  
getDbFacade().getStorageServerConnectionDao().remove(connectionId);
Line 26:                  setSucceeded(true);
The remove api doesn't throw an SQLException ? I did not get this point. If 
remove did not remove any entry, never SQLException is thrown at all API that I 
am familiar with.
Also if entry is not in DB, why a command should failed?
Line 27:              }
Line 28:        }
Line 29:     }


--
To view, visit http://gerrit.ovirt.org/11936
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: Iea5468371514bd2c7bc043a6c5520e2864a09fe8
Gerrit-PatchSet: 4
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Alissa Bonas <[email protected]>
Gerrit-Reviewer: Allon Mureinik <[email protected]>
Gerrit-Reviewer: Liron Aravot <[email protected]>
Gerrit-Reviewer: Maor Lipchuk <[email protected]>
Gerrit-Reviewer: Michael Kublin <[email protected]>
Gerrit-Reviewer: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to