Reputation: 31
I'm writing a small script with python and the module fdb (http://pythonhosted.org//fdb/index.html) which reads data from a firebird database and then writes it into a postgres database. (With psycopg2 module)
Everything works fine except one thing, If I have a query from the firebird database and the connection breaks the program hangs because there is no timeout.
I have searched the fdb documentation but there is no option for it.
How i could add a timeout to my sql queries? or what would be the best way to implement this?
Upvotes: 3
Views: 815
Reputation: 108962
Since Firebird 4.0, Firebird has statement timeouts. Statement timeouts can be configured on three levels:
firebird.conf
and/or databases.conf
with setting StatementTimeout
(timeout in seconds). This establishes the upper-level of a timeout (that means, timeouts on session or statement levels can be lower, but higher values will be ignored)SET STATEMENT TIMEOUT
, which will configure the default timeout for statements in the current session (connection).That said, the statement timeout settings will not protect against broken connections.
Upvotes: 0