aspose file tools*
The moose likes JDBC and the fly likes Size limit in OracleCallableStatement setARRAY Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Size limit in OracleCallableStatement setARRAY" Watch "Size limit in OracleCallableStatement setARRAY" New topic
Author

Size limit in OracleCallableStatement setARRAY

Vikram Phale
Greenhorn

Joined: Aug 23, 2004
Posts: 3
Sorry for posting this article somewhere else before.

I am trying to pass an array object of type oracle.sql.ARRAY to Oracle stored procedure; most of the times I am successful at that. It was found after a customer reported an error that when the array had certain number of elements in it, the code failed. I didnt find out the exact threshold value at which the code broke. Upto around 1000 elements in the array it worked fine. At 1500 it failed. I am working with WebLogic Server 8.1 SP4, Oracle at client 9.2.0.5 and at server 9.2.0.6. I am using direct JDBC OCI connection and not the Weblogic connection pool. Below is the code which is causing the problem.



Even before the OracleCallableStatement is executed it breaks right at the setARRAY method.

The exception thrown is:
Caused by: java.sql.SQLException: Invalid argument(s) in call
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
at oracle.jdbc.dbaccess.DBItem.setArrayData(DBItem.java:262)
at oracle.jdbc.dbaccess.DBDataSetImpl.setADTBindItem(DBDataSetImpl.java:2738)
at oracle.jdbc.driver.OraclePreparedStatement.setARRAY(OraclePreparedStatement.java:1760)
at com.pearson.report.persistence.StudentMasteryDAO.getStudentMasteryData(StudentMasteryDAO.java:116)
... 8 more

Can someone please help me understand why this exception is thrown? How can I get over this problem?

Thanks,
Vikram Phale.

[ April 10, 2007: Message edited by: Vikram Phale ]
[ April 10, 2007: Message edited by: Vikram Phale ]
Vikram Phale
Greenhorn

Joined: Aug 23, 2004
Posts: 3
It is a bug introduced in 9.2.0.5.
Bug 4057147 - JDBC OCI returns invalid argument exception when binding over 64kb array.
Using JDBC Thin drive works.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Size limit in OracleCallableStatement setARRAY
 
Similar Threads
Need Help with pl/sql (Compilation Error)
Size limit on OracleCallableStatement setARRAY ?
Getting array of Oracle Objects
Passing Nested Type from Java to DB
Issue with entering data from Java class file to Database