Menu

#357 AS400JDBCPooledConnection throws SQL0713 and writes in the joblog

JDBC
closed-fixed
5
2017-01-09
2014-11-18
Norbolsa
No

As the change to 1.17 of com.ibm.as400.access.AS400JDBCPooledConnection (jtopen 8.3) when returning the pooled connection we got an error SQL0713 in the joblog of the qzdasoinit.

Tracing we got that the issue is when trying to set the default schema, as we don't have a default schema.

Thread[main,5,main] lun nov 17 17:37:54:657 CET 2014 as400: static method Connection XXXXXXXX (977042272) : Throwing exception, id: 1 error class: 1 return code: -713 reason: [SQL0713] El valor para SCHEMA no es correcto. state: 42815.java.sql.SQLSyntaxErrorException: [SQL0713] El valor para SCHEMA no es correcto.
at com.ibm.as400.access.JDError.createSQLExceptionSubClass(JDError.java:869)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:706)
at com.ibm.as400.access.JDError.throwSQLException(JDError.java:676)
at com.ibm.as400.access.AS400JDBCStatement.commonExecute(AS400JDBCStatement.java:1021)
at com.ibm.as400.access.AS400JDBCPreparedStatement.executeUpdate(AS400JDBCPreparedStatement.java:1825)
at com.ibm.as400.access.AS400JDBCConnection.setSchema(AS400JDBCConnection.java:5637)
at com.ibm.as400.access.AS400JDBCPooledConnection.returned(AS400JDBCPooledConnection.java:404)
at com.ibm.as400.access.AS400JDBCPooledConnection.fireConnectionCloseEvent(AS400JDBCPooledConnection.java:219)
at com.ibm.as400.access.AS400JDBCConnectionHandle.close(AS400JDBCConnectionHandle.java:194)

This is the offending code:

try {
connection_.setSchema(defaultSchema_);
} catch (Exception e) {
// Ignore errors on setSchema. If this code
// cannot set the schema, then other code
// code not set the schema.
}

It should check if the defaultSchema_ is a valid schema

Discussion

  • Norbolsa

    Norbolsa - 2014-11-19

    One possible fix is this:
    try {
    if (defaultSchema_!=null) {

                connection_.setSchema(defaultSchema_);
    
         }
    

    } catch (Exception e) {
    // Ignore errors on setSchema. If this code
    // cannot set the schema, then other code
    // code not set the schema.
    }

     

    Last edit: Norbolsa 2014-11-19
  • Norbolsa

    Norbolsa - 2014-11-19

    The code above doesn't work allways

     

    Last edit: Norbolsa 2014-11-19
  • John Eberhard

    John Eberhard - 2017-01-09
    • status: open --> closed-fixed
    • assigned_to: John Eberhard
     
  • John Eberhard

    John Eberhard - 2017-01-09

    This looks like the setSchema(*LIBL) problem, which was been fixed.

    Closing.

     

Log in to post a comment.

MongoDB Logo MongoDB