如何在hikari上的单个连接下设置多个查询执行的单独会话,
我对我的雪花有单一的联系,并且执行多个查询给出了相同的会话ID,
我想为在单个getConnection下执行的每个查询创建单独的会话ID如何执行此操作?
我正在使用Snowflake,Spring Boot应用程序和Hikaricp
I have single getConnection to my snowflake and executing the multiple queries gives same session id
I want to create separate session id for each query executed under single getConnection How to do this ?
I am using snowflake ,spring boot application and hikariCP
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
GetConnection API将创建一个会话,这是您从连接池中获得的单个连接。
该连接不能进一步分配。
对于您的方案,您可以调用多个会话的多个getConnection API,然后将每个会话用于每个SQL查询执行。
在配置文件中,您可以为池中的连接设置最大值和最小值。
请参阅此链接以获取更多详细信息
https://www.cloudnativemaster.com/post/how-to-to-create-a-jdbc-connection-pol------------------------------------------------------------------------- in-hikaricp-cache-using-in-hikaricp-cache-using-using-using-using-using-using-using-using-ins-using-using-using-using-guava-cache-cache-in-springboot
The getConnection API will create a session, it's a single connection which you get from pools of connections.
This connection can not be further divided.
For your scenario, you can call multiple getConnection API for multiple sessions and then use each session for each SQL query execution.
In the configuration file, you can set the max and min values for connections in the pool.
Please refer to this link for more details
https://www.cloudnativemaster.com/post/how-to-create-a-jdbc-connection-pool-based-on-hikaricp-cache-using-guava-cache-in-springboot