Closed perdelt closed 5 months ago
https://github.com/baztian/jaydebeapi/pull/88?_pjax=%23js-repo-pjax-container#issuecomment-478479171
def _set_stmt_parms(self, prep_stmt, parameters):
for i in range(len(parameters)):
prep_stmt.setObject(i + 1, parameters[i])
prep_stmt.setQueryTimeout(QUERY_TIMEOUT)
jaydebeapi.Cursor._set_stmt_parms = _set_stmt_parms
apparently helps
It doesn't. This ticket should not be closed.
Traceback (most recent call last):
File "/Users/iancleasby/Repos/Github/DBMS-Benchmarker/dbmsbenchmarker/benchmarker.py", line 152, in singleRun
connection.executeQuery(queryString)
File "/Users/iancleasby/Repos/Github/DBMS-Benchmarker/dbmsbenchmarker/tools.py", line 613, in executeQuery
self.cursor.execute(queryString)
File "/Users/iancleasby/.pyenv/versions/DBMS-Benchmarker/lib/python3.9/site-packages/jaydebeapi/__init__.py", line 532, in execute
self._set_stmt_parms(self._prep, parameters)
File "/Users/iancleasby/Repos/Github/DBMS-Benchmarker/dbmsbenchmarker/tools.py", line 40, in _set_stmt_parms
prep_stmt.setQueryTimeout(jaydebeapi.QUERY_TIMEOUT)
TypeError: No matching overloads found for org.postgresql.jdbc.PgStatement.setQueryTimeout(NoneType), options are:
public void org.postgresql.jdbc.PgStatement.setQueryTimeout(int) throws java.sql.SQLException
Easiest work around was setting a 10 min timeout.
What version of JayDeBeApi do you use?
You are right, it only helps if a timeout is set, for example like
{
'name': 'Some simple queries',
'connectionmanagement': {
'timeout': 5 # in seconds
},
'queries':
[
{
'title': "Count all rows in test",
'query': "SELECT COUNT(*) FROM test",
'numRun': 10
}
]
}
v0.11.16 should handle missing timeouts correctly, thanks!
The effect seems to depend on the DBMS
for singleConnection