openjpa-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sathish (JIRA)" <j...@apache.org>
Subject [jira] [Created] (OPENJPA-2210) Method executeQuery cannot be used for update. ERRORCODE=-4476, SQLSTATE=null
Date Tue, 12 Jun 2012 01:46:43 GMT
Sathish created OPENJPA-2210:
--------------------------------

             Summary:  Method executeQuery cannot be used for update. ERRORCODE=-4476, SQLSTATE=null
                 Key: OPENJPA-2210
                 URL: https://issues.apache.org/jira/browse/OPENJPA-2210
             Project: OpenJPA
          Issue Type: Question
          Components: jdbc, jpa
    Affects Versions: 1.0.0
         Environment: Windows 7, 64 bit operating system , RAD - 8.0.4, WAS 7.0, db2jcc4.jar,

            Reporter: Sathish
            Priority: Critical


I am using OpenJPA 1.x to persist the datas using the Application Server WAS 7.0. Now I created
a 'named-native-sql' to perform a join operation and its corresponding sql-result set mapping
in my orm.xml to get the records. THe configuration is as follows

		<named-native-query name="getPaymentById" result-set-mapping="sql_result">
			<query>SELECT T1.*, T2.*, T3.* FROM SSP.PMNT T1 LEFT JOIN SSP.PMNT_REF T2 ON T1.PYMT_ID
= T2.PYMT_ID LEFT JOIN SSP.RMRK T3 ON T1.PYMT_ID = T3.PYMT_ID WHERE T1.PYMT_ID = 8 
			</query>
		</named-native-query>		
		<sql-result-set-mapping name="sql_result">
			<entity-result entity-class="Payment"></entity-result>
			<entity-result entity-class="PaymentReference"></entity-result>
			<entity-result entity-class="Remark"></entity-result>
		</sql-result-set-mapping>



Now when the application runs i am getting the following exception


Caused by: com.ibm.db2.jcc.am.SqlException: [jcc][10103][10941][3.58.81] Method executeQuery
cannot be used for update. ERRORCODE=-4476, SQLSTATE=null

at com.ibm.db2.jcc.am.ed.a(ed.java:660)
at com.ibm.db2.jcc.am.ed.a(ed.java:60)
at com.ibm.db2.jcc.am.ed.a(ed.java:120)
at com.ibm.db2.jcc.am.tm.a(tm.java:3945)
at com.ibm.db2.jcc.am.um.b(um.java:3455)
at com.ibm.db2.jcc.am.vm.Zb(vm.java:144)
at com.ibm.db2.jcc.am.vm.executeQuery(vm.java:127)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.pmiExecuteQuery(WSJdbcPreparedStatement.java:1105)
at com.ibm.ws.rsadapter.jdbc.WSJdbcPreparedStatement.executeQuery(WSJdbcPreparedStatement.java:726)

Please let me know what could be the error and how to resolve it. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message