preventing OraSession to connect to database even when connected in Designtime

Discussion of open issues, suggestions and bugs regarding ODAC (Oracle Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mxwx
Posts: 25
Joined: Mon 14 Nov 2005 08:22

preventing OraSession to connect to database even when connected in Designtime

Post by mxwx » Mon 28 Jan 2008 11:06

Hello,

I have some difficulties to understand how to prevent TOraSession to connect to Database when starting (initializing) up.

I use a database for development which is not reachable for my customers. When I forget to disable the connected state in TOraSession (which is enabled while designtime) for the release version of the program they complain that at startup the database is not reachable.

How can I prevent TOraSession to connect to the Database I explicitly say to connect to. Or maybe, how do I make sure, that it is ceonnected only while in designtime I tried something together with the beforeconnect event and the DisconnectedMode and KeepDesignConnected Options but that doesn't work till now. I also found nothing about the options in the documentation. Is there a new version of the documentation available.

mxwx
Posts: 25
Joined: Mon 14 Nov 2005 08:22

Post by mxwx » Mon 28 Jan 2008 11:07

it should read:

How can I prevent TOraSession to connect to the Database BEFORE I explicitly say to connect to.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Mon 28 Jan 2008 12:43

To prevent a TOraSession component from connecting to the database when creating a form, set KeepDesignConnected option to False.

This option is described in ODAC help (you can find it using Index).

If the option does not work for your application, please specify exact ODAC version you are using (see Oracle | About ODAC in the Delphi menu).

mxwx
Posts: 25
Joined: Mon 14 Nov 2005 08:22

Post by mxwx » Mon 28 Jan 2008 16:05

Thanks for the answer. I have tried all of this and it doesn't worked. But after some further investigation I think I have found the problem.

Assume you have one or more OraSessions and some OraQueries. Both of the OraSessions have KeepDesignConnected option set to false. All of the OraQuerries are Active := true. You can get the strange effect that one of them is connecting and directly disconnecting (without doing anything else in between) when you have not bound every OraQuerry to a session. That seems to be the problem. Some (in my case 2 of 18) of the OraQuerries wasn't connected to a OraSession (session property not set). After setting the Session Property to a not nil value it seems to be working.[/img]

AlexandreECAD
Posts: 40
Joined: Wed 30 Nov 2005 15:55
Location: Brazil

GExperts

Post by AlexandreECAD » Mon 28 Jan 2008 16:57

At my work I use GExperts expert "Set Component Property". Just configure the ConnectString property to receive a null string.

Plash
Devart Team
Posts: 2844
Joined: Wed 10 May 2006 07:09

Post by Plash » Tue 29 Jan 2008 10:07

We have fixed the problem with KeepDesignConnected when Session property is not set. The fix will be included in the next build of ODAC.

Post Reply