Calling a DLL with NET option activated

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
wchris
Posts: 51
Joined: Thu 09 Jun 2005 09:44

Calling a DLL with NET option activated

Post by wchris » Mon 12 Dec 2005 08:56

Since the two or three last ODAC versions we have problems when calling a dll with .net option activated.

We get the error message OCI_INVALID_HANDLE.

When using the oracle client everything is fine.


Any idea ?

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Mon 12 Dec 2005 13:40

We did not encountered with this problem.
Please send us complete sample to demonstrate it and include script to create server objects (tables) to ODAC support address. Please specify versions of Delphi, Oracle server.

wchris
Posts: 51
Joined: Thu 09 Jun 2005 09:44

Post by wchris » Mon 19 Dec 2005 14:02

hello again,

It took some time to build the sample...

It's a modified version of the DLL demo project shipped with ODAC

The following changes :
- We are using options.net := true
- We have a datamodule in the dll containing another Torasession
- We are using the assignconnect command to assign the session in the datamodule

The advantages :
We have many tables and stored procs in datamodules... having a Torasession as a visual component does not require such command in the source code :
OraQuery.session := Externalsession
because everything is done visualy in components. But then the assignconnect command is needed.

The problem :
When setting options.net := false everything is OK
When setting options.net := true we get message 'INVALID_OCI_HANDLE'

I'm available for more information if you need

Thanks

wchris
Posts: 51
Joined: Thu 09 Jun 2005 09:44

Post by wchris » Mon 19 Dec 2005 15:16

Tip :

To use my sample you must change the connection informations in the Torasession to put yours, and change the select clause in the toraquery to use one of your tables instead of mine.

good luck

Paul
Posts: 725
Joined: Thu 28 Oct 2004 14:06

Post by Paul » Tue 20 Dec 2005 08:16

You must include OraNet to the uses clause of DLLMain.pas and call InitNet procedure instead of InitOCI in ShowForm.
Last edited by Paul on Tue 20 Dec 2005 09:14, edited 1 time in total.

wchris
Posts: 51
Joined: Thu 09 Jun 2005 09:44

Post by wchris » Tue 20 Dec 2005 09:12

Hello,

Thank you for the fast answer, i'll try this as soon as possible and tell you if it's ok.

Have a nice day.

wchris
Posts: 51
Joined: Thu 09 Jun 2005 09:44

Post by wchris » Fri 23 Dec 2005 09:17

Hello,

We added the units in the uses list, and the following test in the DLL.

if (Wsession.Options.Net = False) then
InitOCI
else
InitNet;

Now everything is working fine.

Thanks a lot.
We wish you a Merry Christmas
and a happy New Year.

Best Regards
Chris

Post Reply