[ 
https://issues.apache.org/jira/browse/DERBY-3325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12562123#action_12562123
 ] 

Kristian Waagan commented on DERBY-3325:
----------------------------------------

Dan wrote:
-----
There are existing non-SQL exceptions that use MessageUtil directly to obtain 
the localized text. A code search should find an example.
-----
Okay. So I guess it is okay to put all kinds of messages that need localization 
in SQLState.


Dan wrote:
-----
My point was I'm not sure why the factory methods even need to know about 
maxStatements. Encapsulating the logic within the the connection pooling data 
source and the connection pooling object would seem to make more sense. E.g. 
the pooling data source passes a parameter to the constructor of its pooling 
connection implementation that is maxStatements. Then all the pooling logic is 
self-contained in the pooled connection. If you could point to a patch and 
where the factory methods need to know about maxStatements, maybe I could 
understand what the issue is better.
-----
Okay, then I understand your concern.
Your suggestion then falls under "one could change the method signatures" (more 
specifically add an extra argument), which would include some of the methods in 
ClientJDBCObjectFactory (and the two implementations) and the constructors of 
ClientPooledConnection. Seems the data source reference is still needed.

The currently attached patch shows how it could be done by adding a 
getMaxStatements method to ClientBaseDataSource.
The data source creates its pooled connections through the JDBC factory (code 
from jdbc.ClientConnectionPoolDataSource):
    private PooledConnection getPooledConnectionX(LogWriter dncLogWriter, 
                        ClientBaseDataSource ds, String user, 
                        String password) throws SQLException {
            return ClientDriver.getFactory().newClientPooledConnection(ds,
                    dncLogWriter, user, password);
    } 

Have I understood you correctly by saying you suggest one could add 
maxStatements to the code block above (and all other required places)?
Note that it is the methods I have called the factory methods that are invoking 
the PooledConnection constructor, and thus they must have a mean to obtain 
maxStatements if we add it to the constructor.

> Add 'maxStatements' property to ClientConnectionPoolDataSource
> --------------------------------------------------------------
>
>                 Key: DERBY-3325
>                 URL: https://issues.apache.org/jira/browse/DERBY-3325
>             Project: Derby
>          Issue Type: Sub-task
>          Components: JDBC, Network Client
>    Affects Versions: 10.4.0.0
>            Reporter: Kristian Waagan
>            Assignee: Kristian Waagan
>            Priority: Minor
>             Fix For: 10.4.0.0
>
>         Attachments: derby-3325-1a-maxStatements.diff, 
> derby-3325-1a-maxStatements.stat
>
>
> The classes in Derby implementing javax.sql.ConnectionPoolDataSource must 
> provide setter and getter methods for the property 'maxStatements'.
> This property is used to control the whether the data source should produce 
> pooled connections with statement cache capabilities or not, and how big the 
> statement cache is allowed to be.
> This issue only deals with the client JDBC driver.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to