ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mfs <farhan.sar...@gmail.com>
Subject Re: Protocol Error - SimpleDataSource.pushConnection() when using oraclecursors
Date Wed, 07 May 2008 06:03:10 GMT

So turns out it was jdbc driver version issue, though initially i was using
the jdbc driver version as my database version but i had to upgrade to the
next rather the latest version in the 10 series i.e. 10.2.0.4.0 to get the
problem fixed..


Thanks anyways..



mfs wrote:
> 
> Guys,
> 
> I just started using iBatis, and i think its a great framework, and would
> want to employ the same in our company for the persistance layer...Also
> "iBatis in Action" is a very well written book, great job Clinton, Larry
> and Brandon...
> 
> Anyways coming to the problem...So am facing this "protocol voilation"
> error when using oraclecursors (have followed the example on wiki)
> propogated on SimpleDataSource.pushConnection() with the stack trace
> below...using selects just works fine its just when using oraclecursors i
> face this problem
> 
> Also after the stack trace i have posted by sqlmap-config and sqlmapping
> itself and the client.. 
> 
> would appreciate any input..
> 
> Exception in thread "main" java.sql.SQLException: Protocol violation
> 	at
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:166)
> 	at
> oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:217)
> 	at oracle.jdbc.driver.DatabaseError.check_error(DatabaseError.java:1377)
> 	at oracle.jdbc.driver.T4C7Ocommoncall.receive(T4C7Ocommoncall.java:132)
> 	at oracle.jdbc.driver.T4CConnection.do_rollback(T4CConnection.java:530)
> 	at
> oracle.jdbc.driver.PhysicalConnection.rollback(PhysicalConnection.java:1291)
> 	at
> com.ibatis.common.jdbc.SimpleDataSource.pushConnection(SimpleDataSource.java:527)
> 	at
> com.ibatis.common.jdbc.SimpleDataSource.access$100(SimpleDataSource.java:52)
> 	at
> com.ibatis.common.jdbc.SimpleDataSource$SimplePooledConnection.invoke(SimpleDataSource.java:954)
> 	at $Proxy0.close(Unknown Source)
> 	at
> com.ibatis.sqlmap.engine.transaction.jdbc.JdbcTransaction.close(JdbcTransaction.java:81)
> 	at
> com.ibatis.sqlmap.engine.transaction.TransactionManager.end(TransactionManager.java:111)
> 	at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.endTransaction(SqlMapExecutorDelegate.java:782)
> 	at
> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.endTransaction(SqlMapSessionImpl.java:176)
> 	at
> com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.endTransaction(SqlMapClientImpl.java:154)
> 	at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.autoEndTransaction(SqlMapExecutorDelegate.java:883)
> 	at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:622)
> 	at
> com.ibatis.sqlmap.engine.impl.SqlMapExecutorDelegate.queryForList(SqlMapExecutorDelegate.java:589)
> 	at
> com.ibatis.sqlmap.engine.impl.SqlMapSessionImpl.queryForList(SqlMapSessionImpl.java:118)
> 	at
> com.ibatis.sqlmap.engine.impl.SqlMapClientImpl.queryForList(SqlMapClientImpl.java:95)
> 
> 
> <-- XYZCertificate.xml -->
> 
> <sqlMap namespace="Certificate">
> 
>   <typeAlias alias="certificate"
> type="company.xyzcore.domain.Certificate"/>
> 
>   <resultMap id="certificateResult" class="exemptionCertificate">
>     <result property="certificateId" column="CERT_ID"/>
>     <result property="name" column="NAME"/>
>     </resultMap>
> 
>   <parameterMap id="outCursorParamMap" class="map">
>   		<parameter property="criteriaParam" jdbcType="int"
> javaType="java.lang.Integer" mode="IN"/>
> 		<parameter property="outputCursorParam" jdbcType="ORACLECURSOR"
> mode="OUT" resultMap="certificateResult" />
>   </parameterMap>
> 
>   <procedure id="getCertificateByCertificateId"
> parameterMap="outCursorParamMap">
>          { call test.concept_test_api.get_cert_id(?, ?) }
>   </procedure>
> 
> </sqlMap>
> 
> 
> 
> <!-- SQL MAP CONFIG -->
> 
> <sqlMapConfig>
> 
> <transactionManager type="JDBC" commitRequired="false">
> 		<dataSource type="SIMPLE">
> 			<property name="JDBC.Driver" value="oracle.jdbc.OracleDriver" />
> 			<!--property name="JDBC.ConnectionURL"
> value="jdbc:oracle:thin:@192.168.111.212:1521:somedb" /-->
> 			<property name="JDBC.ConnectionURL"
> value="jdbc:oracle:thin:@//192.168.111.106:1521/mydb" />
> 			<property name="JDBC.Username" value="myusername" />
> 			<property name="JDBC.Password" value="mypassword" />
> 		</dataSource>
> </transactionManager>
> 
>   <sqlMap resource="company/xyz/core/persistence/XYZCertificate.xml"/>
> 
> </sqlMapConfig>
> 
> Caller code
> -------------------
> 
>         String resource;
>         Reader reader;
>         SqlMapClient sqlMap;
>         resource = "company/xyz/core/persistence/sql-map-config.xml";
>         reader = Resources.getResourceAsReader(resource);
>         sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);
> 
>      
>         HashMap params = new HashMap();
>         params.put("criteriaParam", new Integer(11));
>         List list = sqlMap.queryForList("getCertificateByCertificateId",
> params); 
> 
> 
> Thanks in advance..
> 
> 

-- 
View this message in context: http://www.nabble.com/Protocol-Error---SimpleDataSource.pushConnection%28%29-when-using-oraclecursors-tp17093837p17097949.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.


Mime
View raw message