[ 
https://issues.apache.org/jira/browse/DERBY-3325?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Kristian Waagan updated DERBY-3325:
-----------------------------------

    Attachment: DataSourceReferenceTest.diff
                DataSourceReferenceTest.java

When investigating the issue around introducing maxStatements into the
client side data source(s), I ended up basically rewriting
jdbcapi.DataSourceReferenceTest.  The reason was that I had some trouble
understanding it at first, and also that I needed more flexibility now
that the three data source types (basic, connection pool and XA) are not
equal any more.

Does anyone have feedback on the (early) new version?
Is it bad to rewrite it that heavily?
(I recommend looking at the class itself, rather than the diff)

If no one looks at it, I will commit it soon (after doing some more
experiments running the new and old test to confirm that the errors the
old uncovered are still uncovered in the new test).
I have also attached a fix to DERBY-2559, which caused the test to be
disabled for client data sources when running Java SE 6.


Regarding solving the maxStatement issue, the method in
ClientBaseDataSource cannot be named getMaxStatements if we do not add a
setter as well. Having only the setter breaks the JavaBean / Reference
contract and the JVM code fails with an NPE when it tries to create a
new instance of the data source (using Reference). I solved this by
giving the method another name. It will always return 0 in CBCP, whereas
it will be overridden to return maxStatements in CPDS (and eventually
XADS). This method will be used to obtain a value for maxStatements in
the PooledConnection constructor to determine if statement caching shall
be enabled or not.

There are also alternative solutions by changing the method signatures.
I will go for the former approach unless anyone clearly state their
misapproval of it, or later testing reveals problems with the approach.

> 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: DataSourceReferenceTest.diff, 
> DataSourceReferenceTest.java, 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