You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Zilin Chen (Created) (JIRA)" <ji...@apache.org> on 2012/02/14 21:23:59 UTC
[jira] [Created] (OPENJPA-2131) Missing IN or OUT parameter
exception with OracleDictionary
Missing IN or OUT parameter exception with OracleDictionary
-----------------------------------------------------------
Key: OPENJPA-2131
URL: https://issues.apache.org/jira/browse/OPENJPA-2131
Project: OpenJPA
Issue Type: Bug
Components: jdbc
Affects Versions: 2.1.1
Environment: Windows with Oracle 11g
Reporter: Zilin Chen
We have generate query with
Query q = em.createQuery("select e._name, e._id, sum(case when e._status=:pending then e._count else 0 end) from Exceptions e, Historty h where e._guid = :guid and .....
then set paramenters for both :pending (in select) and :guid (in where), and call q.setMaxResults(100);
with DB2, everything works fine, and DBDictionary.getSelects() and SQLBuffer.append() will invoke correctly and set parameter of :pending
with Oracle implementation, OracleDictionary.getSelects(Select sel, boolean distinctIdentifiers, boolean forUpdate) will invoke and SQLBuffer.getSQL() get to call (as two if checks are not satisfied and gos to create a new SQLBuffer instance), but this time :pending parameter will missing to add to _param List,
Eventually, we'll get Missing IN or OUT parameter exception from to execute query by preparedStatement
This bug exist in both this branch and trunk.
We have a work around, after SQLBuffer.getSQL() call, add some code to reset _param list.
--
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
[jira] [Resolved] (OPENJPA-2131) Missing IN or OUT parameter
exception with OracleDictionary
Posted by "Albert Lee (Resolved) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-2131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Albert Lee resolved OPENJPA-2131.
---------------------------------
Resolution: Fixed
Fix Version/s: 2.3.0
> Missing IN or OUT parameter exception with OracleDictionary
> -----------------------------------------------------------
>
> Key: OPENJPA-2131
> URL: https://issues.apache.org/jira/browse/OPENJPA-2131
> Project: OpenJPA
> Issue Type: Bug
> Components: jdbc
> Affects Versions: 2.1.1
> Environment: Windows with Oracle 11g
> Reporter: Zilin Chen
> Assignee: Albert Lee
> Fix For: 2.3.0
>
> Attachments: OPENJPA-2131.22x.patch, OracleInOutParameterIssue.patch
>
>
> We have generate query with
> Query q = em.createQuery("select e._name, e._id, sum(case when e._status=:pending then e._count else 0 end) from Exceptions e, Historty h where e._guid = :guid and .....
> then set paramenters for both :pending (in select) and :guid (in where), and call q.setMaxResults(100);
> with DB2, everything works fine, and DBDictionary.getSelects() and SQLBuffer.append() will invoke correctly and set parameter of :pending
> with Oracle implementation, OracleDictionary.getSelects(Select sel, boolean distinctIdentifiers, boolean forUpdate) will invoke and SQLBuffer.getSQL() get to call (as two if checks are not satisfied and gos to create a new SQLBuffer instance), but this time :pending parameter will missing to add to _param List,
> Eventually, we'll get Missing IN or OUT parameter exception from to execute query by preparedStatement
> This bug exist in both this branch and trunk.
> We have a work around, after SQLBuffer.getSQL() call, add some code to reset _param list.
--
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
[jira] [Commented] (OPENJPA-2131) Missing IN or OUT parameter
exception with OracleDictionary
Posted by "Albert Lee (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-2131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13245598#comment-13245598 ]
Albert Lee commented on OPENJPA-2131:
-------------------------------------
Zilin,
I tried your patch and the junit passed for most dbs including Oracle 10g. However I got the 13 additional errors in TestComplexQueries using Oracle 11g with a stack similar to the following:
TestComplexQueries.testComplex1 (org.apache.openjpa.persistence.query)
« Hide stacktrace
<openjpa-2.2.1-SNAPSHOT-r422266:1309047M nonfatal user error> org.apache.openjpa.persistence.ArgumentException: null
at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1042)
at org.apache.openjpa.kernel.ExpressionStoreQuery$DataStoreExecutor.executeDelete(ExpressionStoreQuery.java:792)
at org.apache.openjpa.kernel.QueryImpl.delete(QueryImpl.java:1025)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:822)
at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:888)
at org.apache.openjpa.kernel.QueryImpl.deleteAll(QueryImpl.java:884)
at org.apache.openjpa.kernel.DelegatingQuery.deleteAll(DelegatingQuery.java:558)
at org.apache.openjpa.persistence.QueryImpl.executeUpdate(QueryImpl.java:374)
at org.apache.openjpa.persistence.common.utils.AbstractTestCase.deleteAll(AbstractTestCase.java:191)
at org.apache.openjpa.persistence.common.utils.AbstractTestCase.deleteAll(AbstractTestCase.java:202)
at org.apache.openjpa.persistence.query.TestComplexQueries.clear(TestComplexQueries.java:66)
at org.apache.openjpa.persistence.query.TestComplexQueries.setUp(TestComplexQueries.java:57)
at junit.framework.TestCase.runBare(TestCase.java:125)
at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.runBare(AbstractPersistenceTestCase.java:566)
at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.runBare(AbstractPersistenceTestCase.java:542)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:118)
at org.apache.openjpa.persistence.test.AbstractPersistenceTestCase.run(AbstractPersistenceTestCase.java:206)
at junit.framework.TestSuite.runTest(TestSuite.java:208)
at junit.framework.TestSuite.run(TestSuite.java:203)
at sun.reflect.GeneratedMethodAccessor54.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.apache.maven.surefire.junit.JUnitTestSet.execute(JUnitTestSet.java:213)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:115)
at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:102)
at org.apache.maven.surefire.Surefire.run(Surefire.java:180)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:48)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:600)
at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:350)
at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1021)
Caused by: java.lang.ArrayIndexOutOfBoundsException
at oracle.jdbc.driver.T4CSocketInputStreamWrapper.readLongMSB(T4CSocketInputStreamWrapper.java:201)
at oracle.jdbc.driver.T4CMAREngine.buffer2Value(T4CMAREngine.java:2413)
at oracle.jdbc.driver.T4CMAREngine.unmarshalUB4(T4CMAREngine.java:1353)
at oracle.jdbc.driver.T4CMAREngine.unmarshalSB4(T4CMAREngine.java:1331)
at oracle.jdbc.driver.T4CTTIoac.unmarshal(T4CTTIoac.java:201)
at oracle.jdbc.driver.T4C8TTIuds.unmarshal(T4C8TTIuds.java:139)
at oracle.jdbc.driver.T4CTTIdcb.receiveCommon(T4CTTIdcb.java:200)
at oracle.jdbc.driver.T4CTTIdcb.receive(T4CTTIdcb.java:144)
at oracle.jdbc.driver.T4C8Oall.readDCB(T4C8Oall.java:771)
at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:346)
at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)
at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)
at oracle.jdbc.driver.T4CPreparedStatement.doOall8(T4CPreparedStatement.java:205)
at oracle.jdbc.driver.T4CPreparedStatement.executeForDescribe(T4CPreparedStatement.java:861)
at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1145)
at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1267)
at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(OraclePreparedStatement.java:3449)
at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(OraclePreparedStatement.java:3493)
at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(OraclePreparedStatementWrapper.java:1491)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:96)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:267)
at org.apache.openjpa.lib.jdbc.LoggingConnectionDecorator$LoggingConnection$LoggingPreparedStatement.executeQuery(LoggingConnectionDecorator.java:1116)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:265)
at org.apache.openjpa.jdbc.kernel.JDBCStoreManager$CancelPreparedStatement.executeQuery(JDBCStoreManager.java:1750)
at org.apache.openjpa.lib.jdbc.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:255)
at org.apache.openjpa.jdbc.sql.SelectImpl.executeQuery(SelectImpl.java:499)
at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:424)
at org.apache.openjpa.jdbc.sql.SelectImpl.execute(SelectImpl.java:391)
at org.apache.openjpa.jdbc.sql.LogicalUnion$UnionSelect.execute(LogicalUnion.java:427)
at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:230)
at org.apache.openjpa.jdbc.sql.LogicalUnion.execute(LogicalUnion.java:220)
at org.apache.openjpa.jdbc.kernel.SelectResultObjectProvider.open(SelectResultObjectProvider.java:94)
at org.apache.openjpa.lib.rop.EagerResultList.<init>(EagerResultList.java:34)
at org.apache.openjpa.kernel.QueryImpl.toResult(QueryImpl.java:1251)
at org.apache.openjpa.kernel.QueryImpl.execute(QueryImpl.java:1007)
at org.apache.openjpa.kernel.QueryImpl.deleteInMemory(QueryImpl.java:1031)
... 34 more
------- Stderr: -------
0 TestConv INFO [main] openjpa.Runtime - Starting OpenJPA 2.2.1-SNAPSHOT
1 TestConv INFO [main] openjpa.jdbc.JDBC - Using dictionary class "org.apache.openjpa.jdbc.sql.OracleDictionary".
71 TestConv WARN [main] openjpa.MetaData - OpenJPA cannot map field "org.apache.openjpa.persistence.query.common.apps.RuntimeTest1.selfOneMany" efficiently. It is of an unsupported type. The field value will be serialized to a BLOB by default.
Albert Lee.
> Missing IN or OUT parameter exception with OracleDictionary
> -----------------------------------------------------------
>
> Key: OPENJPA-2131
> URL: https://issues.apache.org/jira/browse/OPENJPA-2131
> Project: OpenJPA
> Issue Type: Bug
> Components: jdbc
> Affects Versions: 2.1.1
> Environment: Windows with Oracle 11g
> Reporter: Zilin Chen
> Attachments: OracleInOutParameterIssue.patch
>
>
> We have generate query with
> Query q = em.createQuery("select e._name, e._id, sum(case when e._status=:pending then e._count else 0 end) from Exceptions e, Historty h where e._guid = :guid and .....
> then set paramenters for both :pending (in select) and :guid (in where), and call q.setMaxResults(100);
> with DB2, everything works fine, and DBDictionary.getSelects() and SQLBuffer.append() will invoke correctly and set parameter of :pending
> with Oracle implementation, OracleDictionary.getSelects(Select sel, boolean distinctIdentifiers, boolean forUpdate) will invoke and SQLBuffer.getSQL() get to call (as two if checks are not satisfied and gos to create a new SQLBuffer instance), but this time :pending parameter will missing to add to _param List,
> Eventually, we'll get Missing IN or OUT parameter exception from to execute query by preparedStatement
> This bug exist in both this branch and trunk.
> We have a work around, after SQLBuffer.getSQL() call, add some code to reset _param list.
--
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
[jira] [Commented] (OPENJPA-2131) Missing IN or OUT parameter
exception with OracleDictionary
Posted by "Albert Lee (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-2131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13246477#comment-13246477 ]
Albert Lee commented on OPENJPA-2131:
-------------------------------------
The additional failures have nothing to do with the fix. It is caused by a JAXB problem got fixed in jaxb 2.1 (See http://www.java.net/node/661561).
After updated openjpa pom.xml to use 2.2.1 version of jaxb, the problem goes away.
Albert Lee.
> Missing IN or OUT parameter exception with OracleDictionary
> -----------------------------------------------------------
>
> Key: OPENJPA-2131
> URL: https://issues.apache.org/jira/browse/OPENJPA-2131
> Project: OpenJPA
> Issue Type: Bug
> Components: jdbc
> Affects Versions: 2.1.1
> Environment: Windows with Oracle 11g
> Reporter: Zilin Chen
> Attachments: OracleInOutParameterIssue.patch
>
>
> We have generate query with
> Query q = em.createQuery("select e._name, e._id, sum(case when e._status=:pending then e._count else 0 end) from Exceptions e, Historty h where e._guid = :guid and .....
> then set paramenters for both :pending (in select) and :guid (in where), and call q.setMaxResults(100);
> with DB2, everything works fine, and DBDictionary.getSelects() and SQLBuffer.append() will invoke correctly and set parameter of :pending
> with Oracle implementation, OracleDictionary.getSelects(Select sel, boolean distinctIdentifiers, boolean forUpdate) will invoke and SQLBuffer.getSQL() get to call (as two if checks are not satisfied and gos to create a new SQLBuffer instance), but this time :pending parameter will missing to add to _param List,
> Eventually, we'll get Missing IN or OUT parameter exception from to execute query by preparedStatement
> This bug exist in both this branch and trunk.
> We have a work around, after SQLBuffer.getSQL() call, add some code to reset _param list.
--
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
[jira] [Updated] (OPENJPA-2131) Missing IN or OUT parameter
exception with OracleDictionary
Posted by "Zilin Chen (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-2131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zilin Chen updated OPENJPA-2131:
--------------------------------
Attachment: OracleInOutParameterIssue.patch
> Missing IN or OUT parameter exception with OracleDictionary
> -----------------------------------------------------------
>
> Key: OPENJPA-2131
> URL: https://issues.apache.org/jira/browse/OPENJPA-2131
> Project: OpenJPA
> Issue Type: Bug
> Components: jdbc
> Affects Versions: 2.1.1
> Environment: Windows with Oracle 11g
> Reporter: Zilin Chen
> Attachments: OracleInOutParameterIssue.patch
>
>
> We have generate query with
> Query q = em.createQuery("select e._name, e._id, sum(case when e._status=:pending then e._count else 0 end) from Exceptions e, Historty h where e._guid = :guid and .....
> then set paramenters for both :pending (in select) and :guid (in where), and call q.setMaxResults(100);
> with DB2, everything works fine, and DBDictionary.getSelects() and SQLBuffer.append() will invoke correctly and set parameter of :pending
> with Oracle implementation, OracleDictionary.getSelects(Select sel, boolean distinctIdentifiers, boolean forUpdate) will invoke and SQLBuffer.getSQL() get to call (as two if checks are not satisfied and gos to create a new SQLBuffer instance), but this time :pending parameter will missing to add to _param List,
> Eventually, we'll get Missing IN or OUT parameter exception from to execute query by preparedStatement
> This bug exist in both this branch and trunk.
> We have a work around, after SQLBuffer.getSQL() call, add some code to reset _param list.
--
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
[jira] [Commented] (OPENJPA-2131) Missing IN or OUT parameter
exception with OracleDictionary
Posted by "Zilin Chen (Commented) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-2131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13208795#comment-13208795 ]
Zilin Chen commented on OPENJPA-2131:
-------------------------------------
Here is code snapshot of our work around
1, in the method below of org.apache.openjpa.jdbc.sql.OracleDictionary.java (branch 2.1.x)
protected SQLBuffer getSelects(Select sel, boolean distinctIdentifiers,
boolean forUpdate) {
....
if (alias instanceof SQLBuffer){
asString = ((SQLBuffer) alias).getSQL();
selectSQL.appendParamOnly((SQLBuffer) alias); //add line to set parameters
}else{
asString = alias.toString();
}
2, org.apache.openjpa.jdbc.sql.SQLBuffer.java (branch 2.1.x)
>From line 110 - 136
add a work around method appendParamOnly() and overload method append() to call updated append(SQLBuffer buf, int sqlIndex, int paramIndex,
boolean subsels, boolean paramOnly) which will append _sql based on passin boolean paramOnly.
/**
* Append parameters only of the given buffer at the given positions.
*/
public SQLBuffer appendParamOnly(SQLBuffer buf) {
append(buf, _sql.length(), (_params == null) ? 0 : _params.size(),
true, true);
return this;
}
/**
* Append all SQL and parameters of the given buffer at the given positions.
*/
private void append(SQLBuffer buf, int sqlIndex, int paramIndex,
boolean subsels) {
append(buf, sqlIndex, paramIndex, subsels, false);
}
/**
* Append parameters and/or SQL of the given buffer at the given positions.
*/
private void append(SQLBuffer buf, int sqlIndex, int paramIndex,
boolean subsels, boolean paramOnly) {
if (subsels) {
// only allow appending of buffers with subselects, not insertion
if (_subsels != null && !_subsels.isEmpty()
&& sqlIndex != _sql.length())
throw new IllegalStateException();
if (buf._subsels != null && !buf._subsels.isEmpty()) {
if (sqlIndex != _sql.length())
throw new IllegalStateException();
if (_subsels == null)
_subsels = new ArrayList(buf._subsels.size());
for (int i = 0; i < buf._subsels.size(); i++)
_subsels.add(((Subselect) buf._subsels.get(i)).
clone(sqlIndex, paramIndex));
}
}
if(!paramOnly){
if (sqlIndex == _sql.length())
_sql.append(buf._sql.toString());
else
_sql.insert(sqlIndex, buf._sql.toString());
}
.....
> Missing IN or OUT parameter exception with OracleDictionary
> -----------------------------------------------------------
>
> Key: OPENJPA-2131
> URL: https://issues.apache.org/jira/browse/OPENJPA-2131
> Project: OpenJPA
> Issue Type: Bug
> Components: jdbc
> Affects Versions: 2.1.1
> Environment: Windows with Oracle 11g
> Reporter: Zilin Chen
>
> We have generate query with
> Query q = em.createQuery("select e._name, e._id, sum(case when e._status=:pending then e._count else 0 end) from Exceptions e, Historty h where e._guid = :guid and .....
> then set paramenters for both :pending (in select) and :guid (in where), and call q.setMaxResults(100);
> with DB2, everything works fine, and DBDictionary.getSelects() and SQLBuffer.append() will invoke correctly and set parameter of :pending
> with Oracle implementation, OracleDictionary.getSelects(Select sel, boolean distinctIdentifiers, boolean forUpdate) will invoke and SQLBuffer.getSQL() get to call (as two if checks are not satisfied and gos to create a new SQLBuffer instance), but this time :pending parameter will missing to add to _param List,
> Eventually, we'll get Missing IN or OUT parameter exception from to execute query by preparedStatement
> This bug exist in both this branch and trunk.
> We have a work around, after SQLBuffer.getSQL() call, add some code to reset _param list.
--
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
[jira] [Updated] (OPENJPA-2131) Missing IN or OUT parameter
exception with OracleDictionary
Posted by "Zilin Chen (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-2131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Zilin Chen updated OPENJPA-2131:
--------------------------------
Patch Info: Patch Available
> Missing IN or OUT parameter exception with OracleDictionary
> -----------------------------------------------------------
>
> Key: OPENJPA-2131
> URL: https://issues.apache.org/jira/browse/OPENJPA-2131
> Project: OpenJPA
> Issue Type: Bug
> Components: jdbc
> Affects Versions: 2.1.1
> Environment: Windows with Oracle 11g
> Reporter: Zilin Chen
> Attachments: OracleInOutParameterIssue.patch
>
>
> We have generate query with
> Query q = em.createQuery("select e._name, e._id, sum(case when e._status=:pending then e._count else 0 end) from Exceptions e, Historty h where e._guid = :guid and .....
> then set paramenters for both :pending (in select) and :guid (in where), and call q.setMaxResults(100);
> with DB2, everything works fine, and DBDictionary.getSelects() and SQLBuffer.append() will invoke correctly and set parameter of :pending
> with Oracle implementation, OracleDictionary.getSelects(Select sel, boolean distinctIdentifiers, boolean forUpdate) will invoke and SQLBuffer.getSQL() get to call (as two if checks are not satisfied and gos to create a new SQLBuffer instance), but this time :pending parameter will missing to add to _param List,
> Eventually, we'll get Missing IN or OUT parameter exception from to execute query by preparedStatement
> This bug exist in both this branch and trunk.
> We have a work around, after SQLBuffer.getSQL() call, add some code to reset _param list.
--
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
[jira] [Assigned] (OPENJPA-2131) Missing IN or OUT parameter
exception with OracleDictionary
Posted by "Albert Lee (Assigned) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-2131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Albert Lee reassigned OPENJPA-2131:
-----------------------------------
Assignee: Albert Lee
> Missing IN or OUT parameter exception with OracleDictionary
> -----------------------------------------------------------
>
> Key: OPENJPA-2131
> URL: https://issues.apache.org/jira/browse/OPENJPA-2131
> Project: OpenJPA
> Issue Type: Bug
> Components: jdbc
> Affects Versions: 2.1.1
> Environment: Windows with Oracle 11g
> Reporter: Zilin Chen
> Assignee: Albert Lee
> Attachments: OracleInOutParameterIssue.patch
>
>
> We have generate query with
> Query q = em.createQuery("select e._name, e._id, sum(case when e._status=:pending then e._count else 0 end) from Exceptions e, Historty h where e._guid = :guid and .....
> then set paramenters for both :pending (in select) and :guid (in where), and call q.setMaxResults(100);
> with DB2, everything works fine, and DBDictionary.getSelects() and SQLBuffer.append() will invoke correctly and set parameter of :pending
> with Oracle implementation, OracleDictionary.getSelects(Select sel, boolean distinctIdentifiers, boolean forUpdate) will invoke and SQLBuffer.getSQL() get to call (as two if checks are not satisfied and gos to create a new SQLBuffer instance), but this time :pending parameter will missing to add to _param List,
> Eventually, we'll get Missing IN or OUT parameter exception from to execute query by preparedStatement
> This bug exist in both this branch and trunk.
> We have a work around, after SQLBuffer.getSQL() call, add some code to reset _param list.
--
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
[jira] [Updated] (OPENJPA-2131) Missing IN or OUT parameter
exception with OracleDictionary
Posted by "Albert Lee (Updated) (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OPENJPA-2131?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Albert Lee updated OPENJPA-2131:
--------------------------------
Attachment: OPENJPA-2131.22x.patch
Commit Zilin patch in 2.3.0. Attach 2.2.1 patch here for posterity.
> Missing IN or OUT parameter exception with OracleDictionary
> -----------------------------------------------------------
>
> Key: OPENJPA-2131
> URL: https://issues.apache.org/jira/browse/OPENJPA-2131
> Project: OpenJPA
> Issue Type: Bug
> Components: jdbc
> Affects Versions: 2.1.1
> Environment: Windows with Oracle 11g
> Reporter: Zilin Chen
> Assignee: Albert Lee
> Attachments: OPENJPA-2131.22x.patch, OracleInOutParameterIssue.patch
>
>
> We have generate query with
> Query q = em.createQuery("select e._name, e._id, sum(case when e._status=:pending then e._count else 0 end) from Exceptions e, Historty h where e._guid = :guid and .....
> then set paramenters for both :pending (in select) and :guid (in where), and call q.setMaxResults(100);
> with DB2, everything works fine, and DBDictionary.getSelects() and SQLBuffer.append() will invoke correctly and set parameter of :pending
> with Oracle implementation, OracleDictionary.getSelects(Select sel, boolean distinctIdentifiers, boolean forUpdate) will invoke and SQLBuffer.getSQL() get to call (as two if checks are not satisfied and gos to create a new SQLBuffer instance), but this time :pending parameter will missing to add to _param List,
> Eventually, we'll get Missing IN or OUT parameter exception from to execute query by preparedStatement
> This bug exist in both this branch and trunk.
> We have a work around, after SQLBuffer.getSQL() call, add some code to reset _param list.
--
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