Board index » delphi » Table not found

Table not found

In transaction:

1. Insert some records to database.
2. Create a new table. which has a foreign key to table where I previously
inserted records. The creation does not return any error.
3. I want to insert some data into the new table but I get an error that the
table does not exists.

When I look the tables list in the IBConsole I see that the new table exists
but if I want to use it (for select, update) or drop it
I get an error that the table does not exists.

Then I make restart to database and server. And after it the tables are
usable again.

Weird thing is as well, that sometimes the transaction working correctly and
sometimes not.

Seems to be that if I execute the transaction multiple times then starting
from 5th time, it fails.

The transaction is made through JDBC.

Andreas

 

Re:Table not found


Have you tried committing the transaction before you insert the new records
into the new table?

--
Bill

Re:Table not found


Quote
Andreas Sisask wrote:
> In transaction:

> 1. Insert some records to database.
> 2. Create a new table. which has a foreign key to table where I previously
> inserted records. The creation does not return any error.
> 3. I want to insert some data into the new table but I get an error that the
> table does not exists.

> When I look the tables list in the IBConsole I see that the new table exists
> but if I want to use it (for select, update) or drop it
> I get an error that the table does not exists.

> Then I make restart to database and server. And after it the tables are
> usable again.

> Weird thing is as well, that sometimes the transaction working correctly and
> sometimes not.

> Seems to be that if I execute the transaction multiple times then starting
> from 5th time, it fails.

> The transaction is made through JDBC.

> Andreas

  Hi, Andreas. I don't work with JDBC, but any DDL statement should be commited
before using it's result. So you have to use separate transaction to create
table and commit it before inserting in another transation. It's some deviation
from general transaction understanding, but it's so. If you make insert in
snapshot transaction, you have to start it after commiting your DDL's one.

Best regards.

Other Threads