IBatis error while applying parameter map - SQLException caused: cursor is closed

I am debugging a problem with a null ResultsMap formula returned from a stored procedure call through iBatis for java. Here is a truncated copy of the exception I am getting.

DataAccessException: Exception calling procedure
Caused by: com.ibatis.common.jdbc.exception.NestedSQLException: 
--- The error occurred in ibatis-map.xml.  
--- The error occurred while applying a parameter map.  
--- Check the getEmpLoanDistribContribInfoMap.  
--- Check the output parameters (retrieval of output parameters failed).  
--- Cause: java.sql.SQLException: Cursor is closed.

I do not believe that the problem is actually in the parameter map, since similar code works in other areas of the project, but just in case, I turned on the parameter map and the saved proc header.

<parameterMap id="getEmpLoanDistribContribInfoMap" class="map" >
    <parameter property="resultCode" javaType="int" jdbcType="NUMERIC" nullValue="-1" mode="OUT"/>
    <parameter property="client_id" javaType="int" jdbcType="NUMERIC" mode="IN"/>
    <parameter property="emp_nbr" javaType="int" jdbcType="NUMERIC" mode="IN"/>
    <parameter property="general_info" javaType="result" jdbcType="ORACLECURSOR" mode="OUT"/> 
    <parameter property="current_contrib_info" javaType="result" jdbcType="ORACLECURSOR" mode="OUT"/> 
    <parameter property="future_contrib_info" javaType="result" jdbcType="ORACLECURSOR" mode="OUT"/> 
    <parameter property="distrib_info" javaType="result" jdbcType="ORACLECURSOR" mode="OUT"/> 
    <parameter property="loan_info" javaType="result" jdbcType="ORACLECURSOR" mode="OUT"/> 
</parameterMap>

function get_emp_ldc_info (
  client_id                 employees.clt_id%type,
  emp_nbr                   employees.emp_nbr%type,
  general_info              out retire_ref_types.retire_ref_cursor,
  current_contrib_info      out retire_ref_types.retire_ref_cursor,
  future_contrib_info       out retire_ref_types.retire_ref_cursor,
  distrib_info              out retire_ref_types.retire_ref_cursor,
  loan_info                 out retire_ref_types.retire_ref_cursor
) return number is
  retval number;

5 , , . , ( - ?). script, , . .

, , , . , , , , out , . - , ?

+3
1

, , . , , , . .

+2

Source: https://habr.com/ru/post/1754841/


All Articles