Kuali Rice Development
  1. Kuali Rice Development
  2. KULRICE-4414

When using the method getReportQueryIteratorByQuery, call releaseDbResources() to avoid INFO messages in the log

    Details

    • Type: Improvement Improvement
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.0.3
    • Component/s: Development
    • Labels:
      None
    • Similar issues:
      KULRICE-5837When using the method getReportQueryIteratorByQuery, call releaseDbResources() to avoid INFO messages in the log
      KULRICE-3987Incorrect Log info message in superUserDisapprove method.
      KULRICE-5957Several PermissionService methods cannot be used when making SOAP service call
      KULRICE-12003Strictness check logs bunch of messages when using light table
      KULRICE-6311.size() calls in ToString() methods trigger JDBC calls and should be removed
      KULRICE-8407Messagemap Message values(info,error,warning) are not displayed
      KULRICE-368Exception when calling WorkflowInfo routingReport
      KULRICE-1505wrap log statements that assemble strings or call other methods in heavily used methods with if LOG.isxxxEnabled
      KULRICE-7731Validation messages Get Warning+Info Messages does nothing or results in method POST not supported stacktrace
      KULRICE-1850rename the KNSServiceLocator getBean method to clearly indicate that it should only be used by other service locators to get beans only defined in the kns context

      Description

      To avoid the following INFO message in the logs, the method releaseDbResources() should be called once the iterator is no longer needed.

      2010-06-03 12:59:44,051 [Finalizer] D: U: INFO org.apache.ojb.broker.accesslayer.ReportQueryRsIterator :: Found unclosed resources while finalize (causer class: org.apache.ojb.broker.accesslayer.ReportQueryRsIterator) Do automatic cleanup

        Activity

        Hide
        Saurabh Ajmera (Inactive) added a comment -

        Shannon Hess added a comment - 03/Jun/10 03:21 PM
        Example of one I changed in DocumentTypeDAOOjbImpl.java to avoid multiple logs when documents are requeued.

        public Long findDocumentTypeIdByDocumentId(Long documentId) {
        Criteria crit = new Criteria();
        crit.addEqualTo("routeHeaderId", documentId);
        ReportQueryByCriteria query = QueryFactory.newReportQuery(DocumentRouteHeaderValue.class, crit);
        query.setAttributes(new String[]

        { "documentTypeId" });
        /**
        * Begin IU Customization
        * 06-3-2010 - Shannon Hess
        *
        * EN-1904 - add call to releaseDbResources()
        */
        RsIterator iter = (RsIterator)getPersistenceBrokerTemplate().getReportQueryIteratorByQuery(query);

        while (iter.hasNext()) { Object[] row = (Object[]) iter.next(); BigDecimal id = (BigDecimal)row[0]; iter.releaseDbResources(); return new Long(id.longValue()); }
        iter.releaseDbResources();
        /**
        * End IU Customization
        */
        return null;
        }
        [ Show » ]
        Shannon Hess added a comment - 03/Jun/10 03:21 PM Example of one I changed in DocumentTypeDAOOjbImpl.java to avoid multiple logs when documents are requeued. public Long findDocumentTypeIdByDocumentId(Long documentId) { Criteria crit = new Criteria(); crit.addEqualTo("routeHeaderId", documentId); ReportQueryByCriteria query = QueryFactory.newReportQuery(DocumentRouteHeaderValue.class, crit); query.setAttributes(new String[] { "documentTypeId" }

        ); /** * Begin IU Customization * 06-3-2010 - Shannon Hess * * EN-1904 - add call to releaseDbResources() */ RsIterator iter = (RsIterator)getPersistenceBrokerTemplate().getReportQueryIteratorByQuery(query); while (iter.hasNext())

        { Object[] row = (Object[]) iter.next(); BigDecimal id = (BigDecimal)row[0]; iter.releaseDbResources(); return new Long(id.longValue()); }

        iter.releaseDbResources(); /** * End IU Customization */ return null; }

        Show
        Saurabh Ajmera (Inactive) added a comment - Shannon Hess added a comment - 03/Jun/10 03:21 PM Example of one I changed in DocumentTypeDAOOjbImpl.java to avoid multiple logs when documents are requeued. public Long findDocumentTypeIdByDocumentId(Long documentId) { Criteria crit = new Criteria(); crit.addEqualTo("routeHeaderId", documentId); ReportQueryByCriteria query = QueryFactory.newReportQuery(DocumentRouteHeaderValue.class, crit); query.setAttributes(new String[] { "documentTypeId" }); /** * Begin IU Customization * 06-3-2010 - Shannon Hess * * EN-1904 - add call to releaseDbResources() */ RsIterator iter = (RsIterator)getPersistenceBrokerTemplate().getReportQueryIteratorByQuery(query); while (iter.hasNext()) { Object[] row = (Object[]) iter.next(); BigDecimal id = (BigDecimal)row[0]; iter.releaseDbResources(); return new Long(id.longValue()); } iter.releaseDbResources(); /** * End IU Customization */ return null; } [ Show » ] Shannon Hess added a comment - 03/Jun/10 03:21 PM Example of one I changed in DocumentTypeDAOOjbImpl.java to avoid multiple logs when documents are requeued. public Long findDocumentTypeIdByDocumentId(Long documentId) { Criteria crit = new Criteria(); crit.addEqualTo("routeHeaderId", documentId); ReportQueryByCriteria query = QueryFactory.newReportQuery(DocumentRouteHeaderValue.class, crit); query.setAttributes(new String[] { "documentTypeId" } ); /** * Begin IU Customization * 06-3-2010 - Shannon Hess * * EN-1904 - add call to releaseDbResources() */ RsIterator iter = (RsIterator)getPersistenceBrokerTemplate().getReportQueryIteratorByQuery(query); while (iter.hasNext()) { Object[] row = (Object[]) iter.next(); BigDecimal id = (BigDecimal)row[0]; iter.releaseDbResources(); return new Long(id.longValue()); } iter.releaseDbResources(); /** * End IU Customization */ return null; }

          People

          • Assignee:
            Saurabh Ajmera (Inactive)
            Reporter:
            Saurabh Ajmera (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Structure Helper Panel