Unexpected error when calling stored procedure.
Posted by: John Cuyle
Date: February 27, 2020 05:27PM

I'm calling a stored procedure using the Java xdevapi. It returns rows. The stored procedure itself seems to work correctly and I can call it and receive results when using the C++ version of connector, but not Java. I call the procedure like so:

session.sql(
"CALL lockTasks( '" +
TaskInfo.TaskState.Active.toString( ) + "', '" +
nodeId + "', '" +
TimeUtils.utcNow( ).format( DateTimeFormatter.ISO_LOCAL_DATE_TIME ).toString( ) + "', '" +
JsonNodeFactory.instance.arrayNode().addAll( ImmutableList.copyOf( taskIds.stream().map( taskId -> JsonNodeFactory.instance.numberNode( taskId.toLong() ) ).iterator() ) ).toString() + "', '" +
TaskInfo.TaskState.Created.toString( ) + "' )"
).executeAsync( )

I have an error handler chained from the execute call. If I look in the SQL logs, I can see that the command executed:

2020-02-27T23:11:17.098914Z 84 Query CALL lockTasks( 'Active', 'jcuyle-dt2', '2020-02-27T23:11:17.091', '[196,197,198,199,200]', 'Created' )

and if I inspect the rows modified as part of the stored procedure, I can see that they have been modified as expected. But instead of the execAsyc completing and returning my results, my error handler executes and I get the following in my debugger.

error = {CompletionException@23463} "java.util.concurrent.CompletionException: com.mysql.cj.exceptions.WrongArgumentException: Unhandled msg class (class com.mysql.cj.x.protobuf.MysqlxResultset$FetchDoneMoreResultsets) + msg="
detailMessage = "com.mysql.cj.exceptions.WrongArgumentException: Unhandled msg class (class com.mysql.cj.x.protobuf.MysqlxResultset$FetchDoneMoreResultsets) + msg="
cause = {WrongArgumentException@23474} "com.mysql.cj.exceptions.WrongArgumentException: Unhandled msg class (class com.mysql.cj.x.protobuf.MysqlxResultset$FetchDoneMoreResultsets) + msg="
exceptionMessage = null
SQLState = "S1009"
vendorCode = 0
isTransient = false
detailMessage = "Unhandled msg class (class com.mysql.cj.x.protobuf.MysqlxResultset$FetchDoneMoreResultsets) + msg="
cause = {WrongArgumentException@23474} "com.mysql.cj.exceptions.WrongArgumentException: Unhandled msg class (class com.mysql.cj.x.protobuf.MysqlxResultset$FetchDoneMoreResultsets) + msg="
stackTrace = {StackTraceElement[5]@23507}
suppressedExceptions = {Collections$UnmodifiableRandomAccessList@23478} size = 0
stackTrace = {StackTraceElement[12]@23477}
suppressedExceptions = {Collections$UnmodifiableRandomAccessList@23478} size = 0

This error doesn't really help me diagnose the issue. It appears that the mysql library is failing to parse the results correctly upon receipt and bubbling that up to me as an error, but the error message gives me no information I can use to help correct the issue. Any help would be appreciated.

Options: ReplyQuote


Subject
Written By
Posted
Unexpected error when calling stored procedure.
February 27, 2020 05:27PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.