Page 1 of 1

Problems mixing OCI and SQLNET

Posted: Thu 14 Apr 2011 15:49
by a.bartusch
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;

Posted: Fri 15 Apr 2011 06:55
by AlexP
Hello,

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