Page 1 of 1

Oracle 11g client, OCIUnicode, and "preconnect" keyword

Posted: Wed 04 Aug 2010 20:58
by desslock43
Hi,

We've noticed an interesting issue involving the latest version of ODAC and Oracle 11g clients. I was wondering if anyone else has experienced this issue, and if there's a workaround. The issue occurs when we try to connect to a database (Oracle 10 or higher) using an 11g client, OraCall's OCIUnicode is True, and the FAILOVER_MODE method of "preconnect" is specified in the TNS entry. This seems to result in an error being returned by ODAC of "ORA-01017: Invalid username/password; logon denied".

Below is an example of such a TNS entry where this occurs:

ST554=
(DESCRIPTION=
(ADDRESS_LIST=
(FAILOVER=on)
(LOAD_BALANCE=on)
(SOURCE_ROUTE=off)
(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521))
(ADDRESS=(PROTOCOL=TCP)(HOST=)(PORT=1521))
)
(CONNECT_DATA=
(FAILOVER_MODE=
(TYPE=session)
(METHOD=preconnect)
(RETRIES=20)
(DELAY=3)
)
(SERVER=dedicated)
(SERVICE_NAME=st554)
)
)

From the tests we've done, this is what we've noticed:

1) Attempting to open a connection to this database using ODAC and an Oracle 11g client produces the "invalid username/password" error.

2) Attempting to connect to this database using SQL*Plus and an Oracle 11g client, the connection is able to be made successfully.

3) Attempting to connect to this database using ODAC and an Oracle 10g client, the connection is able to be made successfully.

4) Attempting to connect to this database using SQL*Plus and an Oracle 10g client, the connection is able to be made successfully.

5) Changing the FAILOVER_MODE method to "Basic", or removing the FAILOVER_MODE specifier, then connecting using ODAC and an Oracle 11g client, the connection is able to be made successfully.

6) Removing OraCall.OCIUnicode := True from the source code allows the connection to be made successfully using either an Oracle 10g or 11g client.

Has anyone else noticed this issue; and if so, does anyone have a workaround that would allow us to still be able to keep OraCall.OCIUnicode=True? Any help would be greatly appreciated!

Thanks! :)

-John

Posted: Fri 06 Aug 2010 12:20
by bork
Hello

I reproduced this issue. It seems it is an Oracle Client 11g bug. I debug the ODAC connection and see that ODAC calls the same OCI functions for Oracle client 10 and 11 versions. If SQL*Plus connects properly using Oracle Client 11g it doesn't mean that SQL*Plus is using Unicode environment. If you set OraCall.OCIUnicode=False, then ODAC will connect properly also.

As you see the default value of OraCall.OCIUnicode is False because some Oracle functions work incorrectly if this variable is True. If we find any workaround that would allow to login with OraCall.OCIUnicode=True we will notify you.