Page 1 of 1

Application crahses wenn adding an field to View in runtime

Posted: Thu 04 Jun 2009 11:41
by devartfan
Hey guys,

I have a big problem.

My application uses an oracle 10g database with the devart dbExpress components.

Using the BDE I was able to add and change fields of a View in runtime of the application and the application still works. With DBExpress the application throws an Excesption and Crashes.

Is there a way to resync the Metadata of the database in runtime?

The similar problem occurrs when a stored procedure becomes invalid in runtime. I would expect that the call of the procedure failes until the the stored procedure is valid again. But the call failes anyway.

We have top restart the application each time a stored proc becomes invalid.

Is there a way to avoid this?

thanking you in anticipation.

Greetz DevartFan

Posted: Tue 09 Jun 2009 07:58
by Plash
The problem with a stored procedure may occur if you assign the StoredProcName property at run-time. When you assign this property, the TSQLStoredProc component generates the list of parameters. If the stored procedure is invalid at this time, the Params property is not filled.

If you change the fields of a view, you should close and reopen the corresponding components such as TSQLQuery and TClientDataSet to refresh the metadata.

Posted: Mon 15 Jun 2009 10:05
by devartfan
The thing with the StoredProc is a little bit different, as you understood it.
If you have a running process and the StoredProc is valid, everything is fine!
If the StoredProc is invalid during the process runtime, the driver recognizes, that it is invalid and saves that it is invalid. In the meantime we do a recompilation of the StoredProc and it is valid again. The driver should recognize, that the StoredProc is valid again! That's the problem, the driver does not recognize this! After a restart, it works again. This is a big problem for us, because we have server-processes, which could not be restarted, each time a stored procedure is changed (gets invalid for a short time).

In case of the second problem, I would like to ask you some more questions:
Is there a possibility to refresh the metadata by invoking a method at runtime? Or better: Do you plan to implement a functionality, which reloads the metadata, once a field is changed in a view or a table? Event the "old" Borland Databse Engine was able to handle this.

Posted: Wed 17 Jun 2009 09:05
by Plash
Please specify whether you are assigning a value to the StoredProcName property at desing-time or run-time?

You can refresh the metadata by calling the Close and Open methods.