#293 Oracle Protocol Violation

2.1rc1
closed-accepted
Rob Manning
Core (461)
8
2005-12-02
2005-08-30
Anonymous
No

When attempting to view the "Contents" of a table
through squirrel, I recieve a "Protocol Violation".

I am using Oracle's ojdbc14.jar to perform a
thin-client connection.

I have attached a zip containing the Squirrel Log and
the JDBC Debug Log files for this error.

Side Note: This same ojdbc14.jar file and connection
information works just fine under Squirrel Version
1.1final1

Discussion

  • JDBC and SQuirreL Log files

     
    Attachments
  • Rob Manning
    Rob Manning
    2005-09-10

    Logged In: YES
    user_id=1287991

    Hello,

    Could it be that you are not using at least JDK 1.4 ?

    The reason why I ask is because getResultSetHoldability wasn't
    instroduced until 1.4:

    java.sql.SQLException: Unsupported feature
    at
    oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:134)
    at
    oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:179)
    at
    oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:269)
    at
    oracle.jdbc.dbaccess.DBError.throwUnsupportedFeatureSqlException(DBError.java:689)
    at
    oracle.jdbc.OracleDatabaseMetaData.getResultSetHoldability(OracleDatabaseMetaData.java:4426)

    Rob Manning

     
  • Rob Manning
    Rob Manning
    2005-09-10

    Logged In: YES
    user_id=1287991

    No, that cannot be it since your version is 1.5 (Duh!):

    java.version: 1.5.0_02

    I'm suspecting that it's a driver / server combination
    issue, or perhaps a bug in the Oracle JDBC driver:

    Take a look here
    (http://www.oracle.com/technology/tech/java/sqlj_jdbc/htdocs/jdbc_faq.htm#30_17)

    What does "Protocol Violation" mean?

    The Thin driver throws this exception when it reads
    something from the RDBMS that it did not expect. This means
    that the protocol engine in the Thin driver and the protocol
    engine in the RDBMS are out of synch. There is no way to
    recover from this error. The connection is dead. You should
    try to close it, but that will probably fail too.

    If you get a reproducible test case that generates this
    error, please file a TAR with Oracle Global Support. Be sure
    to specify the exact version numbers of the JDBC driver and
    the RDBMS, including any patches.

    Rob Manning

     
  • Rob Manning
    Rob Manning
    2005-10-04

    Logged In: YES
    user_id=1287991

    I was able to reproduce this problem using a 1.2 version of
    the Oracle JDBC driver (classes12.zip) and JDK 1.4
    connecting to an Oracle 9i database server.(I was also
    seeing some "Not in streaming mode" error messages from the
    driver at the same time) I suspect that there might be some
    incompatibility between the driver and the jvm since 1.4
    introduces various new JDBC API methods (setSavePoint and
    the like) to Connection. I've added code to CVS that will
    detect this condition and warn the user when the session is
    opened. Hopefully this will
    help the user isolate the problem and address it before it
    happens in the future.

     
  • Andrea Aime
    Andrea Aime
    2005-11-15

    Logged In: YES
    user_id=617186

    I'm getting exactly the same kind of error with various
    drivers (both ojdbc14.jar and classes12.jar, althought I get
    different error messages) trying to connect to an oracle 9i
    database over a VPN made with OpenVPN.
    Connecting to a local 9i database does not trigger the problem.

    On the other hand, DbVisualizer is working fine over the VPN
    with the same drivers and java version, and Squirrel 1.1
    final1 is working fine as well, whilst Squirrel 1.2 beta5
    does not work either -> you are probably triggering an
    error, but version 1.1 did not...
    I'm attaching the stack trace I get when I try to see the
    columns of a table.

     
  • Andrea Aime
    Andrea Aime
    2005-11-15

    Logged In: YES
    user_id=617186

    Hum... I don't see a way to attach the file, maybe because
    I'm not the original reporter. Can I send it to someone?

     
  • Rob Manning
    Rob Manning
    2005-11-15

    • milestone: --> 540457
    • assigned_to: colbell --> manningr
     
  • Rob Manning
    Rob Manning
    2005-11-15

    Stack traces submitted by user aaime

     
    Attachments
  • Rob Manning
    Rob Manning
    2005-11-17

    • status: open --> pending-accepted
     
  • Rob Manning
    Rob Manning
    2005-11-17

    • milestone: 540457 --> 2.1rc1
    • priority: 5 --> 8
     
  • Rob Manning
    Rob Manning
    2005-11-17

    Logged In: YES
    user_id=1287991

    From user aaime's stack traces which are now attached, it is
    very evident that two threads (event dispatch and user) are
    attempting to access the ResultSets returned from two methods
    in SQLDatabaseMetaData. I wrote a small driver - which is
    also attached - to find out what happens accessing Oracle's
    DatabaseMetaData concurrently from different threads. It's
    not a pretty picture. Oracle's driver reports Invalid index
    from ResultSet.getString(int) and like calls. Also, I see
    "Stream already closed". So, I believe that the ResultSet
    returned to the threads from calls to DatabaseMetaData may
    in fact be shared internally by other calls. In any case,
    SQLDatabaseMetaData needs some work to protect against
    concurrent access. Just reporting what I've found so far.

    Rob Manning

     
  • Rob Manning
    Rob Manning
    2005-11-17

    concurrency test for Oracle jdbc driver

     
  • Rob Manning
    Rob Manning
    2005-11-29

    Logged In: YES
    user_id=1287991

    Another variant on this same issue was found with a SQL
    Server driver by a co-worker:

    50316 [Thread-2] ERROR
    net.sourceforge.squirrel_sql.client.session.SchemaInfo -
    failed to load table names
    com.microsoft.sqlserver.jdbc.SQLServerException: Invalid
    column name:TABLE_CAT
    at
    com.microsoft.sqlserver.jdbc.SQLServerException.makeFromDriverError(Unknown
    Source)
    at
    com.microsoft.sqlserver.jdbc.SQLServerResultSet.findColumn(Unknown
    Source)
    at
    com.microsoft.sqlserver.jdbc.SQLServerResultSet.getString(Unknown
    Source)
    at
    net.sourceforge.squirrel_sql.client.session.SchemaInfo.loadTables(SchemaInfo.java:761)
    at
    net.sourceforge.squirrel_sql.client.session.SchemaInfo.load(SchemaInfo.java:148)
    at
    net.sourceforge.squirrel_sql.client.session.Session.loadTableInfo(Session.java:632)
    at
    net.sourceforge.squirrel_sql.client.session.Session.access$100(Session.java:65)
    at
    net.sourceforge.squirrel_sql.client.session.Session$1.run(Session.java:190)
    at
    net.sourceforge.squirrel_sql.fw.util.TaskExecuter.run(TaskExecuter.java:82)
    at java.lang.Thread.run(Thread.java:595)

     
    • status: pending-accepted --> closed-accepted
     
  • Logged In: YES
    user_id=1312539

    This Tracker item was closed automatically by the system. It was
    previously set to a Pending status, and the original submitter
    did not respond within 14 days (the time period specified by
    the administrator of this Tracker).