Subject Re: [Firebird-Java] Invalidating Cache
Author Roman Rokytskyy
> Is there any easy way to invalidate the cache in Jaybird?

I assume you mean metadata cache.

> I have a project where I have added a field to a table. I am not able to
> access the field in Jaybird without restarting.

Without restarting what? Server or the connection?

> I am assuming this is a cache issue? Is there a way to reset it via
> Jaybird without a restart?

It should work correctly without restart. Metadata are versioned, so you
will not see the change until you end your current transaction.

However, if I remember correctly, there is/was an issue in ClassicServer,
that metadata were cached on isc_attach_database and were kept so till end
of connection. In SuperServer it worked ok.

So, if this issue is still there, it should be enough to close the
connection. If you use connection pool, this will not help, since connection
will not be closed, only returned to the pool. Currently pool has a
shutdown() method, which will close all connection. However, after shutdown
you cannot obtain connections anymore (at least you should not). So, in this
case you need to add a method called restart() that would walk through all
connection queues and close all idle connections. Also it should mark all
working connections to be physically closed when they are returned back to
the queue.