Icon View Thread

The following is the text of the current message along with any replies.
Messages 11 to 17 of 17 total
Thread Forcing the Creation of Database Objects.
Mon, Feb 1 2016 4:27 PMPermanent Link

Steve Gill

Avatar

Hi Roy,

<<  NO! EDBManager does not create anything without you telling it to. >>

But that's what I'm saying. When I *open* the database in EDBManager it creates the database objects.  And so when the application runs the objects are already created, hence no error when it is done in this sequence.

<< Without code to review, and test,t there's nothing much anyone can do.  >>

Well the original question was if there was any way to *force* EDB to create all of the database objects.  I don't really need a code review.  Smile

So I'm guessing there is no command to do this, eg. tell the catalog to refresh or something like that.  The only way seems to be to open the database and wait for the objects to be created.

<< I also wonder about timing - if your application is accessing the database whilst everything is in the process of being created. >>

Spot on, Roy. Smile Once my custom database server runs the reverse-engineered script to create the database it runs three queries to try to force the creation of the objects, ie. tables, stored procs and functions.  I did this because I didn't want the application to take too long start.

It appears that when the application starts the database object creation is still being done.  Waiting a few minutes solves the problem so the issue is definitely *time related*.  It just hasn't finished creating all of the database objects when the application was being run, which is understandable.  That's fine.  It's got a bit of work to do so the initial run of the application just has to wait.

During my testing I was running the application immediately after installing the server.  That won't be a problem as users are unlikely to try to login immediately after the server is installed.  Even if they do, if they try again it should work fine.

Thanks for your help.  And Tim's and Matthew's too. Smile

= Steve
Tue, Feb 2 2016 5:38 AMPermanent Link

Roy Lambert

NLH Associates

Team Elevate Team Elevate

Steve


>During my testing I was running the application immediately after installing the server. That won't be a problem as users are unlikely to try to login immediately after the server is installed. Even if they do, if they try again it should work fine.

That's easy to do something about. Query the catalog to see if things have been created and stuff up a splash screen if not.

I sort of do the reverse. My app has several threads running in the background. When they shut down they send a message back to the main thread so I know they've gone. If they are still running when the app is closed I loop and put up a MessageDlg saying "'There are background operations in progress. Wait for them to finish before closing TfR?" with Yes & No buttons. Generally if Yes is clicked long enough has passed (we users are dead slow by comparison with the computer) and things just run through. Click no and the app is closed without the cleanup.

Roy
Tue, Feb 2 2016 12:13 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< But that's what I'm saying. When I *open* the database in EDBManager it creates the database objects.  And so when the application runs the objects are already created, hence no error when it is done in this sequence. >>

I need to clarify this for readers in order to avoid any confusion.  When you say "objects", you actually mean "files".  The objects (tables, views, functions, procedures, etc.) are stored in the database catalog and only created via SQL DDL statements, whereas the files that *store* the data for those objects (tables) are created if, and only if, they don't exist when they are first opened (and a warning is logged in the logged events for the current configuration).

As I said via email, you should look into using the new ON SERVER START option with a job that will run your DDL statements at startup.  Then, you can tag on some queries to the end of that same job to force the creation of the files.  That will ensure that you get what you want without having any timing issues.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Feb 2 2016 4:39 PMPermanent Link

Steve Gill

Avatar

Hi Tim,

<< As I said via email, you should look into using the new ON SERVER START option with a job that will run your DDL statements at startup.  Then, you can tag on some queries to the end of that same job to force the creation of the files.  That will ensure that you get what you want without having any timing issues.  >>

Is that in the manual somewhere?  I was unable to find it in the PDF or online manual.

= Steve
Tue, Feb 2 2016 4:42 PMPermanent Link

Steve Gill

Avatar

<< << As I said via email, you should look into using the new ON SERVER START option with a job that will run your DDL statements at startup.  Then, you can tag on some queries to the end of that same job to force the creation of the files.  That will ensure that you get what you want without having any timing issues.  >> >>

<< Is that in the manual somewhere?  I was unable to find it in the PDF or online manual. >>

Never mind, I found it: AT SERVER START.

= Steve
Wed, Feb 3 2016 2:26 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< Never mind, I found it: AT SERVER START. >>

Sorry about that.  I can't even remember something I did last week. Wink

Tim Young
Elevate Software
www.elevatesoft.com
Wed, Feb 3 2016 7:07 PMPermanent Link

Steve Gill

Avatar

<<  Sorry about that.  I can't even remember something I did last week. Wink >>

I have trouble remembering yesterday. Smile
« Previous PagePage 2 of 2
Jump to Page:  1 2
Image