stored-proc-outbound-gateway & Oracle Stored Procedure with OUT SYS_REF_CURSOR
Hi,
I'm trying to use the stored-proc-outbound-gateway to return results from an Oracle SP which has a spec similar to this.
Code:
PROCEDURE get_data
( out_csr OUT SYS_REFCURSOR
, in_param IN table.some_column%TYPE
);
The procedure is being called however I'm not getting results back, even when I try making the proc completely trivial where it just selects sysdate from dual.
The issue seems to be that when it gets to
Code:
JDBCTemplate.call(CallableStatementCreator csc, List<SqlParameter> declaredParameters)
After it calls execute and gets the return value and updateCount these are used to decide whether to extract results.
However since an Oracle Stored procedure doesn't return a result and CallableStatement.execute() defines it's return values as
HTML Code:
Returns:
true if the first result is a ResultSet object; false if the first result is an update count or there is no result
I get return value of false and updateCount of -1 causing this check to evaluate to false and hence no results extracted.
Code:
if (retVal || updateCount != -1) {
returnedResults.putAll(extractReturnedResults(cs, updateCountParameters, resultSetParameters, updateCount));
}
I've never actually tried to call a stored procedure via JDBCTemplate in this manner before instead using
Code:
org.springframework.jdbc.object.StoredProcedure
However in this case this option isn't available as it's all hidden away.
Can anyone advise of options please?
P.S.
Code:
StoredProcOutboundGateway.handleRequestMessage(Message<?> requestMessage)
returns a null in this case rather than sending any message at all. Is this the desired behaviour?
Thanks