Skip to content

Expose PreparedStatement.setQueryTimeout as a property. #271

Description

@jkerak

Currently, after a query times out to SQL server, the query will stay running on the database, even after the thread that executed the query in the java application has closed.

Some queries may still be running hours later after they timed out. By setting the query timeout, the PreparedStatement cancels the running query after the time period has elapsed.

Is it possible to expose a parameter to set the query timeout using PreparedStatement.SetQueryTimeout(int seconds)? I believe it would need to be set as each PreparedStatement was created for execution inside Query.buildPreparedStatement().

It would be ideal if this was an optional property to set while initializing a Sql2o.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions