Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: JDBC OracleConnection setClientIdentifier method

Re: JDBC OracleConnection setClientIdentifier method

From: Tom Maki <yymakit_at_retek.com>
Date: 23 Mar 2004 14:56:35 -0800
Message-ID: <a545f2fc.0403231456.201328b9@posting.google.com>


I forgot to add that I am connecting to an Oracle 9.2 database. The error would cause a core dump on the database side. From the alert log:
ORA-07445: exception encountered: core dump [00000001002FA6F0] [SIGSEGV] [Address not mapped to object] [0x00000001A] [] []

When I used the 9.2 JDBC drivers I would get an exception on the call to clearClientIdentifier(). This looked like it was calling a package that wasn't expecting an IN parameter.

I was hoping to avoid the extra roundtrips with the 9i drivers by using the 10g drivers. Could it be the 10g drivers client identifier methods are not compatible with the 9i database?

yymakit_at_retek.com (Tom Maki) wrote in message news:<a545f2fc.0403230851.31f04e8d_at_posting.google.com>...
> Hi,
>
> Has anyone tried using the setClientIdentifier/clearClientIdentifer
> methods on OracleConnection? We use a connection pool in our app and
> want a way to be able to trace database calls from a given user and
> thought this would suit our needs.
>
> I'm using the 10g (10.1) JDBC thin client driver (ojdbc14.jar). When I
> execute a query after calling the setClientIdentifier method on
> OracleConnection I get this exception:
>
> java.sql.SQLException: No more data to read from socket
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:125)
> at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:162)
> at oracle.jdbc.driver.DatabaseError.check_error(DatabaseError.java:885)
> at oracle.jdbc.driver.T4CMAREngine.unmarshalUB1(T4CMAREngine.java:991)
> at oracle.jdbc.driver.T4CMAREngine.unmarshalSB1(T4CMAREngine.java:941)
> at oracle.jdbc.driver.T4C8Oall.receive(T4C8Oall.java:432)
> at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:112)
> at oracle.jdbc.driver.T4CStatement.execute_for_describe(T4CStatement.java:351)
> at oracle.jdbc.driver.OracleStatement.execute_maybe_describe(OracleStatement.java:896)
> at oracle.jdbc.driver.T4CStatement.execute_maybe_describe(T4CStatement.java:383)
> at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:986)
> at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1125)
> at Test.main(Test.java:20)
>
>
> Here is a sample program to reproduce the error:
>
> import java.sql.ResultSet;
> import java.sql.SQLException;
> import java.sql.Statement;
> import oracle.jdbc.driver.OracleConnection;
> import oracle.jdbc.pool.OracleDataSource;
>
> public class Test
> {
> public static void main(String[] args)
> throws SQLException, ClassNotFoundException
> {
> OracleDataSource dataSource = new OracleDataSource();
> dataSource.setURL("jdbc:oracle:thin:@dev17:1521:dev01");
> dataSource.setUser("scott");
> dataSource.setPassword("tiger");
> OracleConnection conn = (OracleConnection) dataSource.getConnection();
>
> conn.setClientIdentifier("me");
> Statement statement = conn.createStatement();
> ResultSet rs = statement.executeQuery("select sysdate from dual");
> //fails here
> rs.next();
> System.out.println(rs.getString(1));
> rs.close();
> statement.close();
> conn.clearClientIdentifier("me");
>
> conn.close();
> dataSource.close();
> }
> }
>
>
> I got a similar error using the 9i driver, as well.
>
> Any ideas?
>
> Thanks,
> Tom
>
> p.s. since setClientIdentifier/clearClientIdentifer in the 10g drivers
> what should one use instead?
Received on Tue Mar 23 2004 - 16:56:35 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US