Problem with AssignConnect and Oracle.Direct *** UPDATE ***

Discussion of open issues, suggestions and bugs regarding UniDAC (Universal Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
invent
Posts: 92
Joined: Tue 16 Jun 2009 10:59
Location: Bielefeld, Germany

Problem with AssignConnect and Oracle.Direct *** UPDATE ***

Post by invent » Sat 12 Jun 2010 17:54

Hi,

I just tried the example-code in UniDac\Demos\Miscellaneous\Dll. I want to give an existing UniConnection from my Exe to the DLL.

The code works fine with InterBase and Oracle (with Client).

Than I set the specific option Oracle.Direct=True and AssignConnect failed.

I tried this with Delphi 7, Oracle 8, InterBase 2007 and UniDac Prof 2.70.0.9.

Do you have an idea what's going wrong?

Thanks in advance for any information.

Kind regards,
Gerd Brinkmann
invent GmbH
Last edited by invent on Tue 06 Jul 2010 17:48, edited 1 time in total.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Mon 14 Jun 2010 09:38

Hello

Thank you for the information. We have reproduced your issue. We will notify you as soon as we have any result.

invent
Posts: 92
Joined: Tue 16 Jun 2009 10:59
Location: Bielefeld, Germany

Post by invent » Tue 06 Jul 2010 17:46

Hi,

yesterday I installed UniDac 3.00.0.10 instead of 2.70.0.9 and today I have massive problems with Oracle direct mode! On every PC in our company the software crashes.

I made a try .. except in my code:

try
MyUniConnection.AssignConnect (ExterneConnection);
except
MyUniConnection.Connect;
end;

This works fine with UniDAC 2.70.0.9. With Interbase and Oracle (with Client) AssignConnect is successful and in Oracle direct mode I got a new connection in the Except-case.

I made this, because I hoped for a quick solution from Devart. Then I have not to change the code.

With UniDAC 3.00.0.10 the software crashes. Access-violation, invalid pointer-operations, the exe finished without messages or the UniConnection in the exe is invalid.

What can I do? I don't want to install Oracle clients. And I don't want to go back to UniDAC 2.70.0.9.

Kind regards,
Gerd Brinkmann
invent GmbH

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Wed 07 Jul 2010 14:14

Hello

The cause of all errors that you see is assigning connection incorrectly. It can happen if new connection is located in DLL. This error is fixed and this fix will be included in the next ODAC build.

invent
Posts: 92
Joined: Tue 16 Jun 2009 10:59
Location: Bielefeld, Germany

Post by invent » Wed 07 Jul 2010 15:38

Hi bork,

thanks for your reply. I hoped, that this error was fixed in Unidac 3.00.0.10, so i installed it. The problem was, that now there are more errors than in Uniac 2.7.

Okay, I'll be patient. In the meantime I removed all AssignConnects.

But now there is another problem: Without using AssignConnect UniDac makes in the DLL a new connection and this takes a little while. The User, who see no effect of pushing a button, pushes the button again and gets an Access Violation. Maybe it's critical to start two UniConnections in the same moment.

Kind regards,
Gerd Brinkmann
invent GmbH

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Thu 08 Jul 2010 11:16

Hi

If you use DLL then calling AssignConnect is a correct way. The error that you found can occur if assigning direct connection only and if assigning this connection to DLL (assigning inside the same application works correctly).

If you bought UniDAC with source code then we can send you the fixed unit right now.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Mon 12 Jul 2010 13:42

Hello

Also you can temporary modify your code and add calling InitNet and InitOCI (this modification fixes the error with assign connection until new ODAC build is released):

begin
InitNet;
InitOCI;
OraSession.AssignConnect(ExternalSession);
end;

To call the InitNet procedure you should add the OraNet unit to the USES section.

In the new ODAC build the calling of InitNet and InitOCI will be added to the AssignConnect method.

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Mon 19 Jul 2010 15:49

Hello

We have reproduced this problem and fixed it. This fix will be included in the next ODAC build.

invent
Posts: 92
Joined: Tue 16 Jun 2009 10:59
Location: Bielefeld, Germany

Post by invent » Fri 23 Jul 2010 14:43

Hi bork,

sorry about the late reply. I made some days holyday.

Do you know Murphy's law? I bought UniDac with source until this summer. But there was no need to use the source, so I renewed the subscription without source.

But it doesn't matters, i can wait until the next update.

One short question: You wrote "This fix will be included in the next ODAC build." Does this mean, that the next UNIDAC build is fixed too?

Kind regards,
Gerd Brinkmann
invent GmbH

bork
Devart Team
Posts: 649
Joined: Fri 12 Mar 2010 07:55

Post by bork » Fri 23 Jul 2010 16:14

Hello

Yes, this fix will be included in next UniDAC build as well.

Post Reply