Page 1 of 1

preventing OraSession to connect to database even when connected in Designtime

Posted: Mon 28 Jan 2008 11:06
by mxwx
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.

Posted: Mon 28 Jan 2008 11:07
by mxwx
it should read:

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

Posted: Mon 28 Jan 2008 12:43
by Plash
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).

Posted: Mon 28 Jan 2008 16:05
by mxwx
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]

GExperts

Posted: Mon 28 Jan 2008 16:57
by AlexandreECAD
At my work I use GExperts expert "Set Component Property". Just configure the ConnectString property to receive a null string.

Posted: Tue 29 Jan 2008 10:07
by Plash
We have fixed the problem with KeepDesignConnected when Session property is not set. The fix will be included in the next build of ODAC.