4 Replies Latest reply: Nov 5, 2012 9:15 AM by shreevat RSS

    Statement has already been closed

      Hi folks.

      I am getting error "Statement has already been closed" while saving transaction in OAF page (error below).
      This error happens in an specific database and it is intermittent. Sometimes is possible to run all steps successfully.

      Statement: SELECT * FROM (SELECT ShipmentLineEO.SHIP_HEADER_ID, ShipmentLineEO.SHIP_LINE_GROUP_ID, ShipmentLineEO.SHIP_LINE_ID, ShipmentLineEO.SHIP_LINE_NUM, ShipmentLineEO.SHIP_LINE_TYPE_ID, ShipmentLineEO.SHIP_LINE_SRC_TYPE_CODE, ShipmentLineEO.SHIP_LINE_SOURCE_ID, ShipmentLineEO.PARENT_SHIP_LINE_ID, ShipmentLineEO.ADJUSTMENT_NUM, ShipmentLineEO.MATCH_ID, ShipmentLineEO.CURRENCY_CODE, ShipmentLineEO.CURRENCY_CONVERSION_TYPE, ShipmentLineEO.CURRENCY_CONVERSION_DATE, ShipmentLineEO.CURRENCY_CONVERSION_RATE, ShipmentLineEO.INVENTORY_ITEM_ID, ShipmentLineEO.TXN_QTY, ShipmentLineEO.TXN_UOM_CODE, ShipmentLineEO.TXN_UNIT_PRICE, ShipmentLineEO.PRIMARY_QTY, ShipmentLineEO.PRIMARY_UOM_CODE, (select unit_of_measure_tl from mtl_units_of_measure_vl where uom_code = ShipmentLineEO.PRIMARY_UOM_CODE) as primary_uom_desc, ShipmentLineEO.PRIMARY_UNIT_PRICE, ShipmentLineEO.SECONDARY_QTY, ShipmentLineEO.SECONDARY_,...

      ## Detail 0 ## java.sql.SQLException: Statement has already been closed

      Please help to solve this issue.

      Thanks & Regards
        • 1. Re: Statement has already been closed
          Sushant Sharma

          Problem might be that your statement times out or your connection is getting closed when the statement executes.

          • 2. Re: Statement has already been closed
            Hi Sushant,

            So do you think this is not error in code and could be an environment issue?

            • 3. Re: Statement has already been closed
              Sushant Sharma

              Can u paste the code you are using for this ?

              • 4. Re: Statement has already been closed
                How are you saving the transaction (EO or callable statements)? check if the base table has proper index and is analyzed. Issue might be with the connection timeout unless you are closing the statement/connection explicitly.