Skip to content

jdbc: Pooled statements support #181

Closed

Description

@nicktorwald

Need to implement a statement cache to reuse same queries
Statement.isPoolable and Statement.setPoolable methods

Note: By default, a Statement is not poolable when created, and a PreparedStatement and CallableStatement are poolable when created.

Activity

  1. added this to the JDBC MVP milestone on May 6, 2019
  2. Totktonada commented on May 12, 2019

    @Totktonada

    Seems to be connected with tarantool/tarantool#2592 . Don't sure whether it is worth to really hold a statement pool if it will be on the tarantool side and will be transparent. However we should support the API. Should we file another issue to tarantool to support acquring metainfo (results types) before execution of a statement?

  3. nicktorwald commented on May 13, 2019

    @nicktorwald
    Author

    Don't sure whether it is worth to really hold a statement pool if it will be on the tarantool side and will be transparent.

    The poolable statement makes sense in cases when the server supports prepared statements explicitly, say SQL PREPARE-EXECUTE-RELEASE or using binary protocol (i.e. MySQL prepared statements or Postgres prepared statements). The connector will send statement label, received from the server, instead of a full query string. And these labels (+ possibly a result set metadata) are cached/pooled by the connector.
    Transparent prepared statement support looks like a half of victory in pursuit of performance where the connector cannot send/parse fewer bytes and manage server prepared statements lifetime.

    Should we file another issue to tarantool to support acquring metainfo (results types) before execution of a statement?

    Do you mean ParameterMetedata? If so, there is #173 and yes it requires such requests to the server.

  4. Totktonada commented on May 20, 2019

    @Totktonada

    If the API is mandatory (or worth to implement because of another reason) we should support the API, but use non-pooled statements under hood. This is the case for JDBC MVP milestone.

    Otherwise it should be either moved to JDBC + transactions (and marked as blocked by corresponding issue in tarantool) or closed if this is not planned to be supported on the tarantool side. I'll elaborate this part.

    @nicktorwald Can you please investigate whether it the API is mandatory / important?

  5. nicktorwald commented on May 20, 2019

    @nicktorwald
    Author

    This is mandatory but this is also just a hint to the driver. At present, we can support it but ignore the hint.
    API says:

    It is up to the statement pool manager as to whether the hint is used.

    This issue is more about performance and doesn't impact on JDBC functionality.

  6. Totktonada commented on May 20, 2019

    @Totktonada

    Okay. Let's implement it just as API w/o considering the hint for now.

  7. added a commit that references this issue on Jul 5, 2019
    4829deb
  8. self-assigned this
    on Aug 3, 2019
  9. added a commit that references this issue on Aug 7, 2019
    1158d56
  10. added a commit that references this issue on Aug 7, 2019
    fa0bc3f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions