title: ORA-08103: object no longer exists: This error is occuring for Oracle Procedure returning Refcursor from MyBatis
body: <p>When calling a Stored Procedure in Oracle returning refcursor I am getting an error </p>
  
  <pre><code>2011-05-10 03:36:23 DirtiesContextTestExecutionListener [DEBUG] After test method: context [[TestContext@3a363a36 testClass = AccountActivityServiceTest, locations = array&lt;String&gt;['classpath:/com/bnymellon/pwb/pfdetails/service/test/test-application-context.xml'], testInstance = com.bnymellon.pwb.pfdetails.service.test.AccountActivityServiceTest@6d2c6d2c, testMethod = getData@AccountActivityServiceTest, testException = org.springframework.jdbc.UncategorizedSQLException: 
  ### Error updating database.  Cause: java.sql.SQLException: ORA-08103: object no longer exists
  
  ### The error may involve com.bnymellon.pwb.pfdetails.persistence.AccountActivityMapper.getAccountActivityData-Inline
  ### The error occurred while setting parameters
  ### Cause: java.sql.SQLException: ORA-08103: object no longer exists
  
  ; uncategorized SQLException for SQL []; SQL state [72000]; error code [8103]; ORA-08103: object no longer exists
  ; nested exception is java.sql.SQLException: ORA-08103: object no longer exists 
  </code></pre>
  
  <p>I am using Spring MyBatis integraton project. the version of MyBatis is 3.0.4</p>
  
  <p>I can see the Procedure is being executed. The logs are below.</p>
  
  <pre><code>2011-05-10 03:36:16 PreparedStatement [DEBUG] ==&gt;  Executing: {call PWMWI.PAM_TRANSACTION_PKG.ACCOUNT_ACTIVITY( ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)} 
  2011-05-10 03:36:16 PreparedStatement [DEBUG] ==&gt; Parameters: 1987(Integer), 5627(Integer), null, null, 2010-01-01(Date), 2010-12-31(Date), All Asset Classes(String), [All, PYR](String), (String), null
  </code></pre>
  
  <p>My Mapper XMl is as follows:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"&gt;
  &lt;mapper namespace="com.bnymellon.pwb.pfdetails.persistence.AccountActivityMapper"&gt;
      &lt;select id="getAccountActivityData"
          parameterType="com.bnymellon.pwb.pfdetails.common.AccountActivityDTO"
          statementType="CALLABLE"&gt;
          {call PWMWI.PAM_TRANSACTION_PKG.ACCOUNT_ACTIVITY(
          #{userInstance,mode=IN, jdbcType=INTEGER},
          #{accountGroupId,mode=IN,
          jdbcType=INTEGER},
          #{accountId,mode=IN, jdbcType=VARCHAR},
          #{accountId,mode=IN, jdbcType=VARCHAR},
          #{startDate,mode=IN,
          jdbcType=DATE},
          #{endDate,mode=IN, jdbcType=DATE},
          #{assetClass,mode=IN, jdbcType=VARCHAR},
          #{transactionType,mode=IN,
          jdbcType=VARCHAR},
          #{cusipId,mode=IN, jdbcType=VARCHAR},
          #{ticker,mode=IN, jdbcType=VARCHAR},
          #{domainList,mode=OUT,jdbcType=CURSOR,javaType=java.sql.ResultSet,resultMap=aaDataMap})}
      &lt;/select&gt;
  
      &lt;resultMap type="com.bnymellon.pwb.pfdetails.domain.AccountActivity"
          id="aaDataMap"&gt;
          &lt;result column="TICKER" property="ticker" jdbcType="VARCHAR" /&gt;
          &lt;result column="CUSIP" property="cusIp" jdbcType="VARCHAR" /&gt;
          &lt;result column="SECURITY_NAME" property="securityName"
              jdbcType="VARCHAR"&gt;&lt;/result&gt;
          &lt;result column="ASSET_CLASS" property="assetClass" jdbcType="VARCHAR" /&gt;
          &lt;result column="TRADE_DATE" property="tradeDate" jdbcType="DATE" /&gt;
          &lt;result column="SETTLE_DATE" property="settleDate" jdbcType="DATE" /&gt;
          &lt;result column="DESCRIPTION" property="description" jdbcType="VARCHAR" /&gt;
          &lt;result column="RECORD_TYPE" property="description" jdbcType="VARCHAR" /&gt;
          &lt;result column="ACCOUNT_NUMBER" property="accountNumber"
              jdbcType="VARCHAR" /&gt;
          &lt;result column="QUANTITY" property="shares" jdbcType="VARCHAR" /&gt;
          &lt;result column="LONG_DESC" property="transDesc" jdbcType="VARCHAR" /&gt;
          &lt;result column="PORT_NUM" property="indicator" jdbcType="INTEGER" /&gt;
          &lt;result column="AMOUNT" property="amount" jdbcType="VARCHAR" /&gt;
      &lt;/resultMap&gt;
  &lt;/mapper&gt;
  </code></pre>
  
  <p>I am using MyBatis version 3.0.4 and my Oracle driver jar is ojdbc14-10.2.0.3.0.jar</p>
  
  <p>The IN and OUT parameters and their data types for Procedure are as below:</p>
  
  <pre><code>P_USER_INST           NUMBER        IN     
  P_GROUP_ID            NUMBER        IN 
  P_ENTITY_ID           CHAR          IN 
  P_ENTITY_NAME         VARCHAR2 (30) IN   
  P_START_DATE          DATE          IN      
  P_END_DATE            DATE          IN     
  P_ASSETCLASS          CHAR          IN        
  P_TRAN_TYPE           CHAR          IN   
  P_PRIMARY_ASSET_ID    VARCHAR2      IN        
  P_TICKER              VARCHAR2      IN   
  P_ACCOUNT_DETAIL_CUR  REF CURSOR    OUT    
  </code></pre>
  
  <p>My DTO in Java is below(omitting the setter/getter methods)</p>
  
  <pre><code>private Integer userInstance;
  
  private Integer accountGroupId;
  
  private String accountId;
  
  private Date startDate;
  
  private Date endDate;
  
  private String transactionType;
  
  private String ticker;
  
  private String cusipId;
  
  private String assetClass;
  
  private List&lt;AccountActivity&gt; domainList;
  </code></pre>
  
  <p>Any help is highly appreciated as I am clue less what is going on and really stuck on this.</p>