Why am I getting “format error: Property is 'v$session.program'” connecting to Oracle?

牧云@^-^@ 提交于 2019-12-05 13:31:42
Jake Toronto

We figured it out. Our application name was one character too long: it was 49 characters instead of 48 or fewer.

Here's a list of the v$session properties and their length limits:

  • v$session.machine: 64
  • v$session.iname: no limit
  • v$session.ename: no limit
  • v$session.process: 24
  • v$session.program: 48
  • v$session.terminal: 30
  • v$session.osuer: 30

Also, none of the properties can match this regex: .*[\00\(\)].*, which I think means no parentheses.

If you are getting the error and want to see the code, just add an exception breakpoint in your IDE for SQLException. You should end up in a class called T4CConnection.class.

Here's the decompiled code for the method, validateConnectionProperties():

void validateConnectionProperties() throws SQLException {
    super.validateConnectionProperties();
    String var1 = ".*[\\00\\(\\)].*";
    SQLException var2;
    if(this.thinVsessionOsuser == null || !this.thinVsessionOsuser.matches(var1) && this.thinVsessionOsuser.length() <= 30) {
        if(this.thinVsessionTerminal == null || !this.thinVsessionTerminal.matches(var1) && this.thinVsessionTerminal.length() <= 30) {
            if(this.thinVsessionMachine != null && (this.thinVsessionMachine.matches(var1) || this.thinVsessionMachine.length() > 64)) {
                var2 = DatabaseError.createSqlException((OracleConnection)null, 190, "Property is \'v$session.machine\' and value is \'" + this.thinVsessionMachine + "\'");
                var2.fillInStackTrace();
                throw var2;
            } else if(this.thinVsessionProgram == null || !this.thinVsessionProgram.matches(var1) && this.thinVsessionProgram.length() <= 48) {
                if(this.thinVsessionProcess == null || !this.thinVsessionProcess.matches(var1) && this.thinVsessionProcess.length() <= 24) {
                    if(this.thinVsessionIname != null && this.thinVsessionIname.matches(var1)) {
                        var2 = DatabaseError.createSqlException((OracleConnection)null, 190, "Property is \'v$session.iname\' and value is \'" + this.thinVsessionIname + "\'");
                        var2.fillInStackTrace();
                        throw var2;
                    } else if(this.thinVsessionEname != null && this.thinVsessionEname.matches(var1)) {
                        var2 = DatabaseError.createSqlException((OracleConnection)null, 190, "Property is \'v$session.ename\' and value is \'" + this.thinVsessionEname + "\'");
                        var2.fillInStackTrace();
                        throw var2;
                    }
                } else {
                    var2 = DatabaseError.createSqlException((OracleConnection)null, 190, "Property is \'v$session.process\' and value is \'" + this.thinVsessionProcess + "\'");
                    var2.fillInStackTrace();
                    throw var2;
                }
            } else {
                var2 = DatabaseError.createSqlException((OracleConnection)null, 190, "Property is \'v$session.program\' and value is \'" + this.thinVsessionProgram + "\'");
                var2.fillInStackTrace();
                throw var2;
            }
        } else {
            var2 = DatabaseError.createSqlException((OracleConnection)null, 190, "Property is \'v$session.terminal\' and value is \'" + this.thinVsessionTerminal + "\'");
            var2.fillInStackTrace();
            throw var2;
        }
    } else {
        var2 = DatabaseError.createSqlException((OracleConnection)null, 190, "Property is \'v$session.osuser\' and value is \'" + this.thinVsessionOsuser + "\'");
        var2.fillInStackTrace();
        throw var2;
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!