[ 
https://issues.apache.org/jira/browse/CASSANDRA-2475?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13169966#comment-13169966
 ] 

Eric Evans commented on CASSANDRA-2475:
---------------------------------------

bq. If a client is doing it "right," then it will use pooled connections, each 
of which will use PS for each query needed by the app. Hundreds or even 
thousands isn't crazy. So I'd be okay with a limit of 10000 as "practically 
equivalent to unlimited for all intents and purposes, but it might save you 
from a buggy client."

OK.  The second half of that is, how many of those hundreds or even thousands 
will you want to remove during the life of a connection.  For every application 
I could think of, I picture, like you say, a pool of connections that contain a 
PS for each query needed.  The cases where you would no longer need a PS for 
the life of a connection seems exceptional enough that there would be no harm 
in keeping it.

I'm not fundamentally opposed to an API call to remove PSes, I'm just trying to 
keep things simpler if it doesn't actually provide any value.

But this raises something I hadn't considered.  Storing prepared statements per 
connection seems like it could make things awkward.  If you want to access a PS 
on an arbitrary connection pulled from a pool, then you're going to need some 
way of dealing with a connection that doesn't have that PS stored.  Likewise, 
if we have an API for removing them, then you'd need to iterate all open 
connections to remove the others.  Or am I missing something?
                
> Prepared statements
> -------------------
>
>                 Key: CASSANDRA-2475
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-2475
>             Project: Cassandra
>          Issue Type: New Feature
>          Components: API, Core
>    Affects Versions: 1.0.5
>            Reporter: Eric Evans
>            Assignee: Rick Shaw
>            Priority: Minor
>              Labels: cql
>             Fix For: 1.1
>
>         Attachments: 2475-v1.patch, 2475-v2.patch, 2475-v3.1.patch, 
> 2475-v3.2-Thrift.patch, v1-0001-CASSANDRA-2475-prepared-statement-patch.txt, 
> v1-0002-regenerated-thrift-java.txt, 
> v2-0001-CASSANDRA-2475-rickshaw-2475-v3.1.patch.txt, 
> v2-0002-rickshaw-2475-v3.2-Thrift.patch-w-changes.txt, 
> v2-0003-eevans-increment-thrift-version-by-1-not-3.txt, 
> v2-0004-eevans-misc-cleanups.txt, 
> v2-0005-eevans-refactor-for-better-encapsulation-of-prepare.txt, 
> v2-0006-eevans-log-queries-at-TRACE.txt, 
> v2-0007-use-an-LRU-map-for-storage-of-prepared-statements.txt
>
>


--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Reply via email to