Skip to Main Content

Integration

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Parameter type conflict from Toplink 11g when passing ArrayList as input

sdeyFeb 28 2008
When passing ArrayList as an input to a StoredProcedureCall, I am getting the following stacktrace:

t] Exception [TOPLINK-4002] (Oracle TopLink - 11g Release 1 (11.1.1.0.0) (Build 080121)): oracle.toplink.exceptions.DatabaseException
[junit] Internal Exception: java.sql.SQLException: Parameter Type Conflict
[junit] Error Code: 17012
[junit] Call: BEGIN XL_SP_ASSIGN_EVENTLIST(?, usrName=>?, assignUsrkey=>?, assignGrpkey=>?); END;
[junit] bind => [null => eventIdList, FOO1, 117, 0]
[junit] Query: ValueReadQuery()
[junit] at oracle.toplink.exceptions.DatabaseException.sqlException(DatabaseException.java:295)
[junit] at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeDirectNoSelect(DatabaseAccessor.java:724)
[junit] at oracle.toplink.internal.databaseaccess.DatabasePlatform.executeStoredProcedure(DatabasePlatform.java:1627)
[junit] at oracle.toplink.internal.databaseaccess.DatabaseAccessor.basicExecuteCall(DatabaseAccessor.java:534)
[junit] at oracle.toplink.internal.databaseaccess.DatabaseAccessor.executeCall(DatabaseAccessor.java:467)

--------------------------------------------------------------
Here is my code snippet to pass ArrayList as input parameter :


StoredProcedureCall spc = new StoredProcedureCall();
spc.setProcedureName(procedureName);
spc.addUnamedInOutputArgument("eventIdList", "eventIdList", Types.ARRAY,
"EVENTIDS", ArrayList.class);

String argLoggedInUsrName = "usrName";
String argAssignedUsrKey = "assignUsrkey";
String argAssignedGrpKey = "assignGrpkey";
spc.addNamedArgument(argLoggedInUsrName);
spc.addNamedArgument(argAssignedUsrKey);
spc.addNamedArgument(argAssignedGrpKey);
ValueReadQuery query = new ValueReadQuery();
query.setCall(spc);
query.addArgument("eventIdList");
query.addArgument(argLoggedInUsrName);
query.addArgument(argAssignedUsrKey);
query.addArgument(argAssignedGrpKey);

Vector args = new Vector();
ArrayList eventIdList = new ArrayList();
eventIdList.add(new Long(50000));
args.add(eventIdList);
args.add(loggedInUsrName);
args.add(assignedUsrKey);
args.add(assignedGrpKey);
eventIdList = (ArrayList) session.executeQuery(query, args);

This code chunk was working with an earlier build. Would really appreciate any inputs on the error seen.

Please note - the EVENTIDs type in the pl/sql procedure is defined as a VARRAY(100) of NUMBER
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 27 2008
Added on Feb 28 2008
0 comments
2,303 views