Oracle JDBC : Protocol violation

We have batch process running on Solaris servers. We have been using this for several months and one day we started getting JDBC Protocol violation exception from these jobs. This errors happens after several successful database operations and each time it occurs with a different operation. Fix is to use 64 bit VM. To use 64 bit VM pass argument -d64 as command line parameter to Java. We are using Oracle 11g R3, Solaris 5.10 and JDK 1.6.0_21-b06.

java -d64 test.Main

This is the stack trace.

java.sql.SQLException: Protocol violation
Caused by: java.sql.SQLException: Protocol violation
        at oracle.jdbc.driver.T4CTTIfun.receive(
        at oracle.jdbc.driver.T4CTTIfun.doRPC(
        at oracle.jdbc.driver.T4C8Oall.doOALL(
        at oracle.jdbc.driver.T4CPreparedStatement.doOall8(
        at oracle.jdbc.driver.T4CPreparedStatement.executeForRows(
        at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(
        at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(
        at oracle.jdbc.driver.OraclePreparedStatement.executeInternal(
        at oracle.jdbc.driver.OraclePreparedStatement.executeQuery(
        at oracle.jdbc.driver.OraclePreparedStatementWrapper.executeQuery(

Using 64 bit VM has the downside that it almost doubled memory usage. So had to allocate more memory using -Xmx{size}m option.

To verify whether a JVM is running in 64 bit mode, one can use the jinfo command which comes with JDK. First get the process id of the running process. For this use jps which also comes with JDK.


If it gives following error you have to pass -d64 option to it.

Error attaching to process: Attach failed : debuggee is 64 bit, use java -d64 for debugger

jinfo -d64

Then in the output look for If its value is 64 it means it is running in 64 bit mode.


Popular posts from this blog

java.util.logging - Bad level value for property: org.openqa.level

Solaris : Send mail with attachment