Toad World® Forums

Creating entities by script adds them automatically to actual workspace

Hi !

We use macros/scripts for modeling our database. One script function creates new backup/audit tables for each of our “normal” tables. If we start the macro and have accidently opened any workspace at that time, the created entities are automatically added to the actual workspace.

As this is not intended, we must manually remove them after each function call. The main problem with this is however the slow perfomance. If no workspace is opened, the function creates the entities (about 50) in a few seconds. With a workspace opened it takes several minutes.

Is there any solution ?

Thanks Reiner.

Hi,

try to open your workspace, right click the workarea and select Workspace Format. On tab General uncheck the Auto Complete checkbox. Try to do it for all workspaces. I guess the problem is that when this option is activated, new objects are automatically added to the workspace(s).

Regards,

Vaclav

Hi Vaclav !

Thanks for your help.
Your proposal solves a part of the problem. With unchecked option “Auto Complete” the newly created entities will now not be created as part of the actual workspace.

What still can be seen is the difference in performance with having opened or closed the workspace. For information: workspace closed: up to 5 secs, workspace opened: up to 3 minutes.

Regards,
Reiner.

Hi Reiner,

this is interesting… None of the open workspaces has the option enabled, correct?
We will do test tomorrow and let you know our findings.

Regards,

Vaclav

Hi Vaclav !

This is correct. Each workspace has the auto complete option unchecked.

Regards Reiner.

Hi Reiner,

please send us the package to modeling@quest.com, ideally with some sample model (for the same target database that you use). We did some tests but were not able to reproduce the problem.

Regards,

Vaclav

Hallo Vaclav !

A model and a package including the test script was sent to modeling@quest.com this afternoon.

Regards
Reiner

Hallo Vaclav !

Is there meanwhile any new progress in detecting that behaviour ?

Regards
Reiner

Hi,

I apologize for the delayed response.

Instead of CreateNewObject method you can use CreateNewObjectInternal. In the first case messages are sent to Model Exploerer and Designer and TDM tries to find it on workspace and redraw the workspace. In the second case no message is sent. To evoke the “refresh” you can use Model.RefreshAllWorkspaces() method. However there is one small disadvantage - Model Explorer cannot be refreshed this way, that is why it is necessary to close it and reopen in order to see the changes.

BTW: right click the Model name in Model Explorer and choose Test Model. You will see errors. Right click the model name again and choose Repair Model to fix the problems.

Regards,

Vaclav & Petr