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?
Since Firebird 4.0, Firebird has statement timeouts. Statement timeouts can be configured on three levels:
firebird.confand/ordatabases.confwith settingStatementTimeout(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.