Access Violation when using OCI in Fedora 4

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
jeremy
Posts: 3
Joined: Tue 09 Jan 2007 15:42

Access Violation when using OCI in Fedora 4

Post by jeremy » Tue 09 Jan 2007 19:58

I have created a simple program without any user interface to test connection to Oracle Database. Connecting to database using ODAC net works fine both in Windows XP and Fedora 4. That is, I have set the TOraSession.Options.Net to true and used the connect string as ‘scott/[email protected]:1521:orcl’.

But I wanted to use OCI connect string as ‘scott/tiger@orcl’. Hence we set the TOraSession.Options.Net to false and used the connect string as ‘scott/tiger@orcl’. We added TNS_ADMIN variable in Windows and LINUX to point to oracle_home/network/admin and in that location exists a file tnsnames.ora which contains necessary information about orcl. Our program works under windows. But in Fedora it gives the following error:

Exception EAccessViolation in module OracleTestConsole at 080588AD.
Access violation at address 01A387BE, accessing address 00000000.

I have set the following environment variables:

ORACLE_HOME
TNS_ADMIN=$ORACLE_HOME/network/admin
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$ORACLE_HOME/network/lib

I tested sqlplus using scott/tiger@orcl and it works fine and we are able to connect to the database.

The following is my source code:

program OracleTestConsole;
{$APPTYPE CONSOLE}
uses
Ora, SysUtils;
var
Query : TOraQuery;
Session : TOraSession;
begin
Writeln('Creating Session...');
Session := TOraSession.Create(nil);
Query := TOraQuery.Create(nil);
Session.AutoCommit := True;
Session.ConnectPrompt := False;
Session.LoginPrompt := False;
Session.Options.Net := False;
Session.ConnectString := 'scott/tiger@orcl';
WriteLn('Connecting...');
Session.Connect;
if (Session.Connected ) then
WriteLn('Session successfully connected');
Query.Session := Session;
Query.SQL.Text := 'select * from emp';
Writeln('Executing query...');
Query.Open;
while not Query.Eof
do
begin
Writeln(Query.Fields[1].AsString);
Query.next;
end;
{while}
Writeln('Closing Query & Session');
Query.Close;
Session.Disconnect;
end.

Could it be that I missed any environment setting?

Thanks,
Jeremy

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Wed 10 Jan 2007 08:39

Please supply us the following information:
- Exact version of ODAC. You can see it in About sheet of TOraSesion Editor
- Exact version of your Oracle server and client
- Version of Kylix

jeremy
Posts: 3
Joined: Tue 09 Jan 2007 15:42

Post by jeremy » Wed 10 Jan 2007 10:03

Please find the version numbers below.

Delphi version: Version 7
ODAC version : 5.80.0.35
Oracle Server: 10.2.0.1
Oracle Client: 10.2.0.1
Kylix 3.0

Thanks,
Jeremy

jeremy
Posts: 3
Joined: Tue 09 Jan 2007 15:42

Post by jeremy » Wed 10 Jan 2007 12:49

I have found that OCIVersion is set to 8000 under LINUX in DetectOCI in OraCall. When I changed it to 10201 the program worked. Is there a way of getting the version of OCI from the system rather than hardcoding ?

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Thu 11 Jan 2007 08:57

The problem with access violation was fixed in ODAC 5.80.0.37. You should upgrade your ODAC.
OCI version detection under Linux will be implemented in ODAC 6. We are planning to implement this functionality partially in the next ODAC build as well.

Post Reply