Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-9841

Implement AutoCloseable interface in SQLProcessor Class

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Trivial
    • Resolution: Fixed
    • Affects Version/s: Trunk
    • Fix Version/s: Trunk
    • Component/s: framework
    • Labels:
      None

      Description

      Implement SQLProcessor class with the AutoCloseable interface.

      1. OFBIZ-9841.patch
        18 kB
        Pradhan Yash Sharma
      2. OFBIZ-9841.patch
        11 kB
        Pradhan Yash Sharma

        Activity

        Hide
        PradhanYashSharma Pradhan Yash Sharma added a comment -

        Attaching patch file.

        Show
        PradhanYashSharma Pradhan Yash Sharma added a comment - Attaching patch file.
        Hide
        PradhanYashSharma Pradhan Yash Sharma added a comment -

        Attaching patch file with removed indentation.

        Show
        PradhanYashSharma Pradhan Yash Sharma added a comment - Attaching patch file with removed indentation.
        Hide
        PradhanYashSharma Pradhan Yash Sharma added a comment -

        Added AutoCloseable interface to SQLProcessor class and overridden Close method, Added closing of ResultSet, PreparedStatement and Connection Objects.
        While calling SQLProcessor object in GenericDAO used Try-with-Resources and removed unnecessary calls of the same object before actual use, also removed finally blocks for method invocation.

        Show
        PradhanYashSharma Pradhan Yash Sharma added a comment - Added AutoCloseable interface to SQLProcessor class and overridden Close method, Added closing of ResultSet, PreparedStatement and Connection Objects. While calling SQLProcessor object in GenericDAO used Try-with-Resources and removed unnecessary calls of the same object before actual use, also removed finally blocks for method invocation.
        Hide
        jacques.le.roux Jacques Le Roux added a comment - - edited

        Thanks Yash,

        Your patch is in trunk at revision: 1812144
        I have just formatted both updateByCondition methods

        BTW, why do you consider this a critical bug? Even with the useless but also harmless closings of the passed SQLProcessor in updateByCondition and select methods I see no reasons to consider this a bug, even less a critical one. If you agree please change and close. Else explain and we will need to backport...

        Show
        jacques.le.roux Jacques Le Roux added a comment - - edited Thanks Yash, Your patch is in trunk at revision: 1812144 I have just formatted both updateByCondition methods BTW, why do you consider this a critical bug? Even with the useless but also harmless closings of the passed SQLProcessor in updateByCondition and select methods I see no reasons to consider this a bug, even less a critical one. If you agree please change and close. Else explain and we will need to backport...
        Hide
        PradhanYashSharma Pradhan Yash Sharma added a comment -

        Thank you, Jacques,

        Yes, I agree with you, I have updated the ticket and closed it.

        Show
        PradhanYashSharma Pradhan Yash Sharma added a comment - Thank you, Jacques, Yes, I agree with you, I have updated the ticket and closed it.
        Hide
        PradhanYashSharma Pradhan Yash Sharma added a comment -

        Closing this ticket.

        Show
        PradhanYashSharma Pradhan Yash Sharma added a comment - Closing this ticket.

          People

          • Assignee:
            PradhanYashSharma Pradhan Yash Sharma
            Reporter:
            PradhanYashSharma Pradhan Yash Sharma
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development