ストアド プロシージャは正常に動作します。SQL Navigator でテストしましたが、毎回問題なく動作します。
これは私が得ている例外スタックです:
org.springframework.jdbc.UncategorizedSQLException: CallableStatementCallback; uncategorized SQLException for SQL [{call PKG_RPT_STE_DATA.GETCOREREPORTEXTRAS(?, ?, ?, ?, ?, ?, ?)}]; SQL 状態 [null]; エラーコード [0]; カーソルが閉じています。; ネストされた例外は java.sql.SQLException: Cursor is closed です。org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:83) org.springframework.jdbc.support.AbstractFallbackSQLExceptionTranslator.translate(AbstractFallbackSQLExceptionTranslator.java:80) org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate. java:969) org.springframework.jdbc.core.JdbcTemplate.call(JdbcTemplate.java:1003) org.springframework.jdbc.core.simple.AbstractJdbcCall.executeCallInternal(AbstractJdbcCall.java:391) org.springframework.jdbc.
これが私のJavaコードです(Spring 3.0.5を使用)
private class GetStandardReportExtrasSPV2{
int nAreaLevel;
int nAssignment;
int nUserRole;
int nAcisNum = 0;
String strAreaMenu;
String strLDO = null;
private SimpleJdbcCall procGetReportExtras;
public GetStandardReportExtrasSPV2(DataSource ds, int nUserRole, String strAreaMenu,
int nAssignment, int nAreaLevel, String strLDO, int nAcisNum) {
JdbcTemplate jdbcTemplate = new JdbcTemplate(ds);
jdbcTemplate.setResultsMapCaseInsensitive(true);
this.procGetReportExtras =
new SimpleJdbcCall(jdbcTemplate)
.withCatalogName("PKG_RPT_STE_DATA")
.withProcedureName("GetCoreReportExtras")
.returningResultSet("CURREPORTLIST",
ParameterizedBeanPropertyRowMapper.newInstance(Report.class));
}
public List<Report> getReportsList() {
HashMap<String, Object> params = new HashMap<String, Object>();
params.put("PNASSIGNMENT", new Integer(nAssignment));
params.put("PNUSERROLE", new Integer(nUserRole));
params.put("PSAREAMENU", strAreaMenu);
params.put("PNAREALEVEL", new Integer(nAreaLevel));
params.put("PSLDO", strLDO);
params.put("PNACISNUMBER", new Integer(nAcisNum));
if (nAcisNum > 0)
params.put(ACIS_NUMBER, nAcisNum);
SqlParameterSource in = new MapSqlParameterSource().addValues(params);
Map m = procGetReportExtras.execute(in);
return (List) m.get("CURREPORTLIST");
}
}
そして、これは Oracle ストアド プロシージャです。
PROCEDURE GetCoreReportExtras
( pnAssignment IN NUMBER,
pnUserRole in NUMBER,
psAreaMenu in VARCHAR2,
pnAreaLevel in NUMBER,
curReportList OUT outcur,
psLDO in VARCHAR2 default 'none',
pnAcisNumber in NUMBER default 0) IS
BEGIN
--start working through roles...
IF substr(psAreaMenu,1,1) <> '7' and pnAssignment > 74999 --CAM Area of some sort
THEN
-- these users never get an HBDC or QBR...
--NOTHING WILL BE RETURNED
open curReportList for
SELECT FILE_NAME, NULL AS DISPLAY_TEXT
FROM CORE_REPORT_NAME
WHERE STATIC_REPORT_TYPE = 'XXXXXXXX';
ELSE -- Non-CAM, Non-GPO...Check traditional Sales first...
IF substr(psAreaMenu,1,1) = '7' THEN --Sales Assignment of some sort
-- retrieve the HBDC File Name for these sales users...
open curReportList for
SELECT FILE_NAME, 'Anemia Worksheet Link' AS DISPLAY_TEXT
FROM CORE_REPORT_NAME
WHERE STATIC_REPORT_TYPE = 'HBDCANEMIA'
UNION
SELECT FILE_NAME, 'HBDC Bone Metabolism Worksheet Link' AS DISPLAY_TEXT
FROM CORE_REPORT_NAME
WHERE STATIC_REPORT_TYPE = 'HBDC_BONE';
-- sales-perspective users don't see a QBR...
--NOTHING IS RETURNED FOR QBR
ELSE -- Callpoint or Top-SDO Assignment
IF pnUserRole = 11 THEN --TOP SDO
-- These users don't see HBDC...
--NOTHING IS RETURNED FOR HBDC
-- but they do get the QBR...
open curReportList for
SELECT FILE_NAME, 'CIDO Report Selection' AS DISPLAY_TEXT
FROM CORE_REPORT_NAME
WHERE STATIC_REPORT_TYPE = 'QBR'
and SHORT_NAME = psAreaMenu;
--ELSE -- Some form of Callpoint
-- these perspectives don't get QBR or HBDC
--NOTHING WILL BE RETURNED
END IF;
END IF;
END IF;
END GetCoreReportExtras;
なぜその例外が発生するのかについてのヒントはありますか?