ribaraka commented on issue #357:
URL: 
https://github.com/apache/cassandra-gocql-driver/issues/357#issuecomment-2810524708

   > I'm considering adding this to the scope of 2.0.0 but I'm a bit concerned 
about the impact of the breaking changes. Maybe we can just make these 
functions create a copy of `Session` like [@tux21b](https://github.com/tux21b) 
mentioned
   
   @jameshartig is right. Creating copies of the `Session` can lead to resource 
management challenges. Each `Session` maintains its own connection pool to a 
cluster. Therefore, duplicating sessions can result in redundant connections, 
increasing the load on both the client and the cluster. Moreover, managing the 
lifecycle of these duplicated sessions becomes complex, raising the risk of 
resource leaks if sessions are not properly closed. 
   Why not leverage per-query configuration methods, such as Query.Consistency 
and Query.Trace? They offer flexibility without requiring the creation of 
multiple sessions, aren't they? 
   
   I suggest continue using a single `Session` instance for the application's 
lifecycle, utilizing per-query configurations to handle specific requirements. 
Remove setters and keep session scoped settings to `ClusterConfig`.
   
   I actually like the solution by @Zariel made in 
https://github.com/apache/cassandra-gocql-driver/pull/1290 it just need to be 
reviewed and updated. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@cassandra.apache.org
For additional commands, e-mail: commits-h...@cassandra.apache.org

Reply via email to