Moti Asayag has posted comments on this change. Change subject: core: Cleanup on notification service resource closing ......................................................................
Patch Set 2: (3 inline comments) Please use the new utility class also for EngineMonitorService which is part of the notification service and also uses database resources. .................................................... File backend/manager/modules/utils/src/main/java/org/ovirt/engine/core/utils/db/DbUtils.java Line 10: * Helper methods to handle DB related issues Line 11: */ Line 12: public class DbUtils { Line 13: Line 14: public static void closeQuietly(ResultSet resultSet, Connection connection) { would you mind introducing this method and the one beneath it after the methods of single resource close? Line 15: closeQuietly(resultSet, null, connection); Line 16: } Line 17: Line 18: public static void closeQuietly(ResultSet resultSet, Statement statement, Connection connection) { Line 49: } Line 50: } Line 51: } Line 52: Line 53: public static void closeQuietly(PreparedStatement ps, Connection connection) { Why specifically PreparedStatement and not just Statement ? Line 54: closeQuietly(null,ps,connection); Line 55: } Line 56: .................................................... File backend/manager/tools/engine-notifier/engine-notifier-service/src/main/java/org/ovirt/engine/core/notifier/NotificationService.java Line 195: while (rs.next()) { Line 196: eventSubscribers.add(getEventAuditLogSubscriber(rs)); Line 197: } Line 198: } finally { Line 199: DbUtils.closeQuietly(rs, ps, connection); so much nicer to the eye Line 200: } Line 201: DbUser dbUser = null; Line 202: for (event_audit_log_subscriber eventSubscriber:eventSubscribers) { Line 203: dbUser = getUserByUserId(eventSubscriber.getsubscriber_id()); -- To view, visit http://gerrit.ovirt.org/9740 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I54fb540ee52255f017933b000b9b509c4e156123 Gerrit-PatchSet: 2 Gerrit-Project: ovirt-engine Gerrit-Branch: master Gerrit-Owner: Yair Zaslavsky <yzasl...@redhat.com> Gerrit-Reviewer: Moti Asayag <masa...@redhat.com> Gerrit-Reviewer: Ravi Nori <rn...@redhat.com> Gerrit-Reviewer: Yair Zaslavsky <yzasl...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches