You can't use an external OraSession in dll. For correct work, you should call the AssignConnect method of OraSession (used in Dll) having sent the external OraSession as a parameter. This approach is used in the demo project in the ShowForm method. If you use only one session, you can instantly call the AssignConnect method for the internal OraSession. We have included an additional variable ExternalSession to be used in several OraSessions declared on different forms in dll.
What is the preferred method for assigning a connection in a DLL
Question
I am using ODAC v8.2.8 or perhaps 9. with Delphi 5.
I have an application which can launch a number of applications implemented as dlls. In order to share the launcher's database connection the AssignConnect()
method is used.
I have noticed one of the Devart demos performs just the same task by simple assignment
var
ExternalSession: TOraSession;
procedure AssignSession(Session: TOraSession); cdecl;
begin
ExternalSession := Session;
end;
Which is the Devart recommended method to use?
Solution
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow