Subject Re: [Firebird-Java] Database Schema refresh only after Connection restart
Author William L. Thomson Jr.
On Fri, 2007-09-28 at 14:35 +0000, Peter Welch wrote:
> Roman,
>
> I've encountered an unexpected behavior in Jaybird -- that it won't
> refresh the database schema until the database connection is
> restarted. I was trying to debug a trigger and made numerous changes
> to the trigger and other stored procedures using IB_SQL and nothing
> seemed to work. Specifically, I added columns in an update statement
> -- the existing columns updated data just fine but nothing from the
> added columns. After restarting the database connection, it all worked
> as coded. So, is there a setting to force a refresh/synchronization of
> the database schema in the Jaybird client?

To my knowledge what you are experiencing is not specific to JayBird but
database transactions. Once a transaction has started, it's not going to
be able to see other changes, like changes to meta data. That would
require a new transaction, or in your case, new connection. You can
start a new transaction/statement in Jaybird, which is likely what you
need to do. Or just close the connection and re-connect.

> Also, possibly a related issue, I haven't been sending commits after
> my stored procedure calls -- so far it's storing the data but I wonder
> if it might be a lurking problem. If I'm not ending transactions then
> the database schema would have to be preserved until the current
> transaction/s get committed -- I presume, anyway. Should I be
> attempting explicit commits or does Jaybird handle transaction commits
> automatically?

By default the driver starts in auto-commit mode ( going from memory ).
So if your not calling commit, nor did you change the mode. It's in auto
commit if your data is actually being committed and retained. Otherwise
if not in auto-commit mode, your data would be tossed once
connection/transaction ends. If commit wasn't explicitly called.

--
William L. Thomson Jr.
Gentoo/Java


[Non-text portions of this message have been removed]