Beuth-Erdelt / DBMS-Benchmarker

DBMS-Benchmarker is a Python-based application-level blackbox benchmark tool for Database Management Systems (DBMS). It connects to a given list of DBMS (via JDBC) and runs a given list of parametrized and randomized (SQL) benchmark queries. Evaluations are available via a Python interface and on an interactive multi-dimensional dashboard.
GNU Affero General Public License v3.0
13 stars 2 forks source link

Set timeout via JDBC URL #57

Closed perdelt closed 3 months ago

perdelt commented 3 years ago

for singleConnection

perdelt commented 3 years 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

PenguinRage commented 3 years ago

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.

perdelt commented 3 years ago

What version of JayDeBeApi do you use?

perdelt commented 3 years ago

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!

perdelt commented 2 years ago

The effect seems to depend on the DBMS