2 Replies Latest reply on Apr 6, 2012 3:48 PM by 928807

    Exception when ibatis call a oracle function through oracle UCP

    928807

      Early thanks to anybody who might have insight on this issue

      need some insight from the oracle JDBC expert.

      I have a oracle function defined in ibatis config as below:
      <parameterMap id="getSessionTimeOutParameterMap" class="java.util.Map">
      <parameter property="timeout" jdbcType="NUMERIC" javaType="java.lang.Long" mode="OUT" />
      <parameter property="userId" jdbcType="NUMERIC" javaType="java.lang.Long" mode="IN" />
      <parameter property="defaultValue" jdbcType="NUMERIC" javaType="java.lang.Long" mode="IN" />
      </parameterMap>
      <procedure id="getSessionTimeout" parameterMap="getSessionTimeOutParameterMap">
      {? = call get_user_timeout(?,?)}
      </procedure>

      if call this through ibatis code:
      Map<String, Object> map = new HashMap<String, Object>();
      map.put("userId", 1737691L);
      map.put("defaultValue", 60L);
      map.put("timeout", null);
      sqlmap.queryForObject("trading.getSessionTimeout", map);

      Get exception:
      Caused by: java.lang.RuntimeException: unexpected invocation exception: unexpected invocation exception: null
      at oracle.ucp.jdbc.proxy.PreparedStatementProxyFactory.invoke(PreparedStatementProxyFactory.java:138)
      at oracle.ucp.jdbc.proxy.CallableStatementProxyFactory.invoke(CallableStatementProxyFactory.java:101)
      at $Proxy17.getResultSet(Unknown Source)
      at com.ibatis.sqlmap.engine.execution.SqlExecutor.getFirstResultSet(SqlExecutor.java:337)
      at com.ibatis.sqlmap.engine.execution.SqlExecutor.handleMultipleResults(SqlExecutor.java:299)
      at com.ibatis.sqlmap.engine.execution.SqlExecutor.executeQueryProcedure(SqlExecutor.java:283)
      at com.ibatis.sqlmap.engine.mapping.statement.ProcedureStatement.sqlExecuteQuery(ProcedureStatement.java:34)
      at com.ibatis.sqlmap.engine.mapping.statement.GeneralStatement.executeQueryWithCallback(GeneralStatement.java:173)

      While the same java function can be called through spring jdbc without any issue


      my UCP data source pool spring definition as below
      <bean id="dataSource" class="oracle.ucp.jdbc.PoolDataSourceFactory" factory-method="getPoolDataSource">
      <property name="URL" value="jdbc:oracle:thin:@abc:9101/dev"/>
      <property name="user" value="user"/>
      <property name="password" value="pass"/>
      <property name="connectionFactoryClassName" value="oracle.jdbc.pool.OracleDataSource"/>
      <property name="connectionPoolName" value="salesConnectionPool"/>
      <property name="connectionWaitTimeout" value="30"/>
      <property name="minPoolSize" value="2"/>
      <property name="maxPoolSize" value="25"/>
      <property name="inactiveConnectionTimeout" value="20"/>
      <property name="timeoutCheckInterval" value="60"/>
      <property name="fastConnectionFailoverEnabled" value="false"/>
      <property name="ONSConfiguration" value="nodes=dev1:6200,dev2:6200"/>
      <property name="validateConnectionOnBorrow" value="true"/>
      <property name="SQLForValidateConnection" value="select 1 from DUAL"/>
      </bean>

      my environment:
      ibatis-sqlmap-2.3.0 build# 677
      ojdbc6-11.2.0.3
      ons-11.2.0
      simplefan-11.2.0.3
      ucp-11.2.0.2

      jdk1.6.0_30
      Oracle Database 11g Enterprise Edition Release 11.2.0.2.0 - 64bit Production
      With the Partitioning, Real Application Clusters, Automatic Storage Management, OLAP, Data Mining and Real Application Testing options

      Edited by: 925804 on Apr 6, 2012 6:08 AM

      Edited by: 925804 on Apr 6, 2012 6:09 AM