Fix duplicate query ID error
Summary
In the JDBC driver every Statement has own request object, but it is shared among requests. If statement object is used by different threads then one thread may copy query_id set by another. Ignoring the fact that threads should not share Statements there should be a proper synchronization when working with shared request object. Current PR implements locking on request object while making copy (seal operation).
Closes:
- https://github.com/ClickHouse/clickhouse-java/issues/1529
Checklist
Delete items not relevant to your PR:
- [ ] Unit and integration tests covering the common scenarios were added
- [ ] A human-readable description of the changes was provided to include in CHANGELOG
I've removed busy check from java11 HttpClientConnection because it doesn't make sense. This is similar to Apache connection but has busy check for some reason. I've inspected the code of the HttpClientConnection and it looks very simple and stateless - that means mostly thread-safe.