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.
preventing OraSession to connect to database even when connected in Designtime
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).
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).
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]
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
At my work I use GExperts expert "Set Component Property". Just configure the ConnectString property to receive a null string.