Subject Re: [IBO] Table in use
Author Russell Belding
Hello Lee

I hope you saw the earlier posts on this topic, especially "InterBase only
allows up to a maximum of 255 versions of each record in the system tables."

In case you did not I repeat the message:

******************
KnowledgeBase Id: 98

Question:
Performing too many ALTER statements may generate
error -607 "Unsuccessful metadata update
-TABLE -too many versions".

Answer:
InterBase only allows up to a maximum of 255 versions of each record in the
system tables. Exceeding the limit produces the error shown above. The 255
record version maximum for a record in a system table is not always reached
because system tables experience garbage collection in the same manner as
user
tables. Look up the index topic of "Garbage collection" in the online
InterBase help for the specifics on how garbage collection is done.

The solution:
- Perform a backup and restore of the database.
******************

However you are not doing an ALTER but a DROP and later I assume a CREATE.

From the 255 warning above it is not clear to me if this applies only to
ALTER statements or to any change to all or part of the IB metadata and
system tables. Who can say that only "ALTER" causes the 255 limit to be hit
or if the limit is hit when 255 other types of changes are made?

Can someone who knows IB in depth discuss this?

This 255 limit is important to know for someone developing an IB Database,
especially during the period of fine tuning parts of the DB design when many
changes can be made during a few days.

So backup and restore needs to be part of a days work.

Anyhow, most think the frequent use of DROP & CREATE inside an IB database
is not a good idea (at least because we do not know how this affects the 255
limit), and there is probably a better way to do what you want to do.

In your code below you are assuming that a DISCONNECT, CONNECT sequence will
remove the cause of the "Object in use" error. I mentioned in a previous
post I had an "Object in use" error which only when away when I did a backup
and restore on the database. I did not investigate this further so I cannot
say what the problem was. While we should not make a rule based on a single
incident there is at least an indication that a DISCONNECT,CONNECT action
may not clear the "Object in use" error.

If an exception is raised during the execution of the code in your "try
Mystatements,except" there may be an exception handler inside the code
handling MyStatements which handles the exception and you do not get a
chance to avoid the error messages.

Regards

Russell

----- Original Message -----
From: "Leeway" <lee@...>
To: <IBObjects@yahoogroups.com>
Sent: Thursday, July 26, 2001 8:19 PM
Subject: [IBO] Table in use


> I still got a problem with dropping of a table.
> I got the 'in use' error.
> This happens 5 times out of 10, so not always.
> I hate it when this happens.
> But now I got another problem, even if I use the try..except methode,
> The user still got the error on the screen.
> I beleved that a try..except prevented that the error shows when
> running the program.
> What am I missing ?
>
> procedure TStat_00.DeleteTableStat;
> begin
> try
> DM.QTIB_Stat.IB_Connection.Disconnect;
> DM.QTIB_Stat.IB_Connection.Connect;
> except;
> end;
>
> try
> DM.RunSql.SQL.Clear;
> DM.RunSql.SQL.Add('drop table STAT');
> DM.RunSql.ExecSQL;
> except;
> end;
> end;
>
>
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>