What about UNIDAC 5.3?ODAC 9.3
Possibility to assign external SvcCtx to connection is added
ORACLE provider: Passing LDA or SvcCtx to dll
-
- Posts: 34
- Joined: Mon 22 Dec 2008 09:03
ORACLE provider: Passing LDA or SvcCtx to dll
In ODAC 9.3.8 you add such posibilites
Re: ORACLE provider: Passing LDA or SvcCtx to dll
Hello,
No, this functionality is no available in UniDAC.
No, this functionality is no available in UniDAC.
-
- Posts: 34
- Joined: Mon 22 Dec 2008 09:03
Re: ORACLE provider: Passing LDA or SvcCtx to dll
Can you add to OraClassesUni.pas following procedures similar to ODAC?
Thanks
Code: Select all
procedure TOCIConnection.AssignSvcCtx(hOCISvcCtx: pOCISvcCtx);
procedure TOCIConnection.AssignSvcCtx(hOCIEnv: pOCIEnv; hOCISvcCtx: pOCISvcCtx);
Re: ORACLE provider: Passing LDA or SvcCtx to dll
UniDAC is a universal product for working with various databases, therefore we cannot implement separate features supported by a particular database.
-
- Posts: 34
- Joined: Mon 22 Dec 2008 09:03
Re: ORACLE provider: Passing LDA or SvcCtx to dll
But Interbase provider already has procedures in IBCClassesUni.pas and we use them to transmit DbHandle in DLLUniDAC is a universal product for working with various databases, therefore we cannot implement separate features supported by a particular database.
Code: Select all
procedure TGDSConnection.SetDatabaseHandle(Value: TISC_DB_HANDLE);
We don't need to broadcast them to the level TUniConnection
We use such code:
Code: Select all
with TUniConnection(Db) do
begin
{$IFDEF Oracle}
if FIConnection is TOCIConnection then
begin
OCIConnection := (FIConnection as TOCIConnection);
hOCISvcCtx := Pointer(PluginData.DatabaseHandle);
if OCIConnection.Direct then
Environment := OracleHomes.Direct.AllocEnvironment(PluginData.hOCIEnv)
else
begin
Home := OracleHomes.GetHome(HomeName);
Environment := Home.AllocEnvironment(OCIConnection.UnicodeEnvironment, 0);
end;
Unicode := StrToBoolDef(SpecificOptions.Values['Oracle.UseUnicode'], False);
TempOCISvcCtx := TOCISvcCtx.Create(Environment, hOCISvcCtx, Unicode);
OCIConnection.SetOCISvcCtx(TempOCISvcCtx);
end;
{$ENDIF}
{$IFDEF InterBase}
if FIConnection is TGDSConnection then
begin
GDSConnection := (FIConnection as TGDSConnection);
GDSConnection.SetDatabaseHandle(Pointer(PluginData.DatabaseHandle));
end;
{$ENDIF}
end;
Code: Select all
with TUniConnection(Db) do
begin
{$IFDEF Oracle}
if FIConnection is TOCIConnection then
begin
OCIConnection := (FIConnection as TOCIConnection);
hOCISvcCtx := Pointer(PluginData.DatabaseHandle);
if OCIConnection.Direct then
OCIConnection.AssignSvcCtx(PluginData.hOCIEnv, hOCISvcCtx)
else
OCIConnection.AssignSvcCtx(hOCISvcCtx);
end;
{$ENDIF}
{$IFDEF InterBase}
if FIConnection is TGDSConnection then
begin
GDSConnection := (FIConnection as TGDSConnection);
GDSConnection.SetDatabaseHandle(Pointer(PluginData.DatabaseHandle));
end;
{$ENDIF}
end;
Re: ORACLE provider: Passing LDA or SvcCtx to dll
We will consider the possibility to add such functionality in one of the next versions.
-
- Posts: 34
- Joined: Mon 22 Dec 2008 09:03
Re: ORACLE provider: Passing LDA or SvcCtx to dll
Any news?We will consider the possibility to add such functionality in one of the next versions.
Re: ORACLE provider: Passing LDA or SvcCtx to dll
Below are working samples of an application and a library demonstrating work with LDA:
Project:
Dll:
Project:
Code: Select all
program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils,
Windows,
Ora, OraCall;
type
TAssignLDA = procedure (LDA: PLDA); cdecl;
var
OraSession: TOraSession;
AssignLDA: TAssignLDA;
hDLL:HModule;
begin
OraSession := TOraSession.Create(nil);
try
OraSession.ConnectString := 'scott/tiger@orcl';
OraSession.Options.UseOCI7 := true;
OraSession.Connect;
hDLL := LoadLibrary('Project2.dll');
if hDLL <> 0 then begin
@AssignLDA := GetProcAddress(hDLL, 'AssignLDA');
if @AssignLDA <> nil then
AssignLDA(OraSession.LDA);
end
finally
OraSession.Free;
end;
end.
Code: Select all
library Project2;
uses
SysUtils,
Classes,
OraCall,
Ora;
procedure AssignLDA(LDA: PLDA); cdecl;
var
OraSession: TOraSession;
begin
OraSession := TOraSession.Create(nil);
try
OraSession.Options.UseOCI7 := true;
OraSession.AssignLDA(LDA);
OraSession.Connect;
finally
OraSession.Free;
end;
end;
exports
AssignLDA;
begin
end.
-
- Posts: 34
- Joined: Mon 22 Dec 2008 09:03
Re: ORACLE provider: Passing LDA or SvcCtx to dll
It`s very nice for ODAC!Below are working samples of an application and a library demonstrating work with LDA:
But what about SvcCtx and UNIDAC?
Re: ORACLE provider: Passing LDA or SvcCtx to dll
This functionality is yet to be available in UniDAC.