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;