Martin Peřina has submitted this change and it was merged.
Change subject: core: early return in batch operations with no elements
......................................................................
core: early return in batch operations with no elements
Seems like currently on every batch operation (save/update/remove) we use a
connection to the database. Not all the callers to these operations verify
that there are actually elements in the collection of entities they pass.
Therefore, we go deep into the stack and get a connection to the database
in order to execute stored procedure that doesn't do anything.
As a solution, this patch suggests to return early without doing anything
in these operations when the passed collection of entities is empty.
Change-Id: I31e10d048e9f6bf63bbc2ac51e330633c7dc3423
Signed-off-by: Arik Hadas <ahadas(a)redhat.com>
---
M
backend/manager/modules/dal/src/main/java/org/ovirt/engine/core/dao/MassOperationsGenericDao.java
1 file changed, 9 insertions(+), 0 deletions(-)
Approvals:
Martin Peřina: Looks good to me, approved
Jenkins CI: Passed CI tests
Arik Hadas: Verified
--
To view, visit
https://gerrit.ovirt.org/54032
To unsubscribe, visit
https://gerrit.ovirt.org/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: I31e10d048e9f6bf63bbc2ac51e330633c7dc3423
Gerrit-PatchSet: 2
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Arik Hadas <ahadas(a)redhat.com>
Gerrit-Reviewer: Arik Hadas <ahadas(a)redhat.com>
Gerrit-Reviewer: Eli Mesika <emesika(a)redhat.com>
Gerrit-Reviewer: Jenkins CI
Gerrit-Reviewer: Martin Peřina <mperina(a)redhat.com>
Gerrit-Reviewer: Shahar Havivi <shavivi(a)redhat.com>
Gerrit-Reviewer: gerrit-hooks <automation(a)ovirt.org>