sfa-siard / siard-suite

Other
6 stars 0 forks source link

Archive fails with error "java.sql.SQLException: Result set after last row" when processing Type #108

Open joelthill opened 2 months ago

joelthill commented 2 months ago

I am trying to archive an oracle database. Processing fails with the following error message:

      Routine: APLKN_ARCHV_ANLUX.FK_ASLH_PRFG_VE_INHLT_MUSS
      Type: APLKN_ARCHV_ANLUX.TBS_VRZNG_ENHT
    ERROR [main] 17:24:04,312 ch.admin.bar.siard2.cmd.SiardFromDb Exception while downloading SIARD archive
    java.sql.SQLException: Result set after last row
            at oracle.jdbc.driver.GeneratedScrollableResultSet.getString(GeneratedScrollableResultSet.java:879) ~[ojdbc6.jar:12.1.0.1.0]
            at oracle.jdbc.driver.GeneratedResultSet.getString(GeneratedResultSet.java:1460) ~[ojdbc6.jar:12.1.0.1.0]
            at ch.admin.bar.siard2.cmd.MetaDataFromDb.createType(MetaDataFromDb.java:366) ~[siardcmd.jar:2.2.13]
            at ch.admin.bar.siard2.cmd.MetaDataFromDb.getProcedureParameters(MetaDataFromDb.java:443) ~[siardcmd.jar:2.2.13]
            at ch.admin.bar.siard2.cmd.MetaDataFromDb.getRoutines(MetaDataFromDb.java:865) ~[siardcmd.jar:2.2.13]
            at ch.admin.bar.siard2.cmd.MetaDataFromDb.getSchemaMetaData(MetaDataFromDb.java:1150) ~[siardcmd.jar:2.2.13]
            at ch.admin.bar.siard2.cmd.MetaDataFromDb.download(MetaDataFromDb.java:1254) ~[siardcmd.jar:2.2.13]
            at ch.admin.bar.siard2.cmd.SiardFromDb.<init>(SiardFromDb.java:302) ~[siardcmd.jar:2.2.13]
            at ch.admin.bar.siard2.cmd.SiardFromDb.main(SiardFromDb.java:371) [siardcmd.jar:2.2.13]
      java.sql.SQLException: Result set after last row

A quick review of the context (the line starting with "Routine:") revealed that FK_ASLH_PRFG_VE_INHLT_MUSS is declared as:

CREATE OR REPLACE FUNCTION APLKN_ARCHV_ANLUX.FK_ASLH_PRFG_VE_INHLT_MUSS (
   pr_vrzng_enht IN TBS_VRZNG_ENHT%ROWTYPE
   )
RETURN INTEGER

My gut feeling tells me that the %ROWTYPE type declaration (line starting with "Type: ") might be the cause of the issue. Other plain vanilla type declarations having been processed without any problems earlier in the process, I am wondering if SIARD is able to handle %ROWTYPE corrrectly?

cheers j.

joelthill commented 1 month ago

Hi Max, Pls let me know if I can help with logs or samples. j.

mburri commented 1 week ago

@joelthill Sorry for the late response!

It's possible that %rowtype is not supported. We need to check this in detail. It would be really helpful if you could provide some sql to set up a minimal sample database to reproduce the problem.

Regarding Oracle databases: We usually use oracle 18-xe or oracle 21-xe.

Which version are you using?

joelthill commented 1 week ago

Hi Max, Let me see what I can come up with as a stripped-down sample. We're on Oracle Database 19c Enterprise Edition, 19.24 as of today. j.