Problems mixing OCI and SQLNET

Discussion of open issues, suggestions and bugs regarding usage of dbExpress drivers for Oracle in Delphi and C++Builder
Post Reply
a.bartusch
Posts: 1
Joined: Thu 14 Apr 2011 15:38

Problems mixing OCI and SQLNET

Post by a.bartusch » Thu 14 Apr 2011 15:49

Hi,

we got some problems when mixing OCI and SQLNET-Connections. I will attach some code on the bottom. Running each of them alone works perfect, but if one of them was run once, the other does not work until restart of the application. It seems that the libraries cannot be switched due runtime.
Perhaps someone has an idea how we can fix that.

Code: Select all

procedure TMiscFunctionsTest.DBXTestOracleOCI;
var
  FConnection: TSQLConnection;
begin
  FConnection := TSQLConnection.Create(nil);
  FConnection.LoginPrompt := false;
  FConnection.ConnectionName := 'ConSense.Database.Connection.Generic';
  FConnection.Params.Clear;
  with FConnection do
  begin
    DriverName := DBXDevartOracle.sDriverName;
    GetDriverFunc := 'getSQLDriverORA';
    LibraryName := 'dbexpoda40.dll';
    VendorLib := 'oci.dll';
  end;
  with FConnection.Params do
  begin
    Add('UseUnicode=True');
    Add('BlobSize=-1');
    Add('Oracle TransIsolation=ReadCommited');
    Add('LongStrings=True');
    Add('EnableBCD=True');
    Add('UseQuoteChar=False');
    Add('FetchAll=False');
    Add('CharLength=0');
    Add('NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS');

    Values['User_Name'] := 'Bartusch';
    Values['Password'] := '';
    Values['Database'] := '';
    Values['HostName'] := 'Csx002';
  end;
  FConnection.Connected := true;

  FConnection.Connected := false;
end;

procedure TMiscFunctionsTest.DBXTestOracleSQLNET;
var
  FConnection: TSQLConnection;
begin
  FConnection := TSQLConnection.Create(nil);
  FConnection.LoginPrompt := false;
  FConnection.ConnectionName := 'ConSense.Database.Connection.Generic';
  FConnection.Params.Clear;
  with FConnection do
  begin
    DriverName := DBXDevartOracle.sDriverNameDirect;
    GetDriverFunc := 'getSQLDriverORADirect';
    LibraryName := 'dbexpoda40.dll';
    VendorLib := 'dbexpoda40.dll';
  end;
  with FConnection.Params do
  begin
    Add('BlobSize=-1');
    Add('Oracle TransIsolation=ReadCommited');
    Add('LongStrings=True');
    Add('EnableBCD=True');
    Add('UseQuoteChar=False');
    Add('FetchAll=False');
    Add('CharLength=0');
    Add('NLS_DATE_FORMAT=YYYY-MM-DD HH24:MI:SS');
    Values['User_Name'] := 'Bartusch';
    Values['Password'] := '';
    Values['Hostname'] := 'Bartusch';
    Values['Database'] := ':1521:XE';
  end;

  FConnection.Connected := true;

  FConnection.Connected := false;
end;

AlexP
Devart Team
Posts: 5530
Joined: Tue 10 Aug 2010 11:35

Post by AlexP » Fri 15 Apr 2011 06:55

Hello,

Now you cannot connect to Oracle simultaneously in different modes (OCI and Direct).
We know about this problem, we are working on it.

Post Reply