[
https://issues.apache.org/jira/browse/DERBY-3324?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kristian Waagan updated DERBY-3324:
-----------------------------------
Attachment: derby-3324-1b-jdbc_statementcache.stat
derby-3324-1b-jdbc_statementcache.diff
'derby-3324-1b-jdbc_statementcache.diff' replaces version 1a.
The following has been changed:
1) Removed keys for statements specifying which auto-generated columns
to get, as we currently don't support this in the client driver.
Handling this area will need some effort (as part of another issue),
as we do support the relevant prepareStatement methods if the array
specifying the columns to get is null.
2) Added a new key for CallableStatement (CallKey).
3) Renamed factory methods from newInstance to newPrepared, and
introduced newCallable.
4) Renamed method in cache from insertStatement to cacheStatement.
5) Various documentation fixes/changes.
6) Chose to throw assert error if closing a statement in the cache
fails. For insane builds, the exception will be ignored.
I forgot to handle CallableStatement explicitly. The way this is planned
now, is to use a separate key for CallableStatements and then cast the
PreparedStatement that comes out of the cache;
CallableStatement cs = (CallableStatement)cache.getCached(CallKey)
I could add more machinery around this, for instance making sure objects
inserted with a CallKey is indeed a CallableStatement, but I'm not sure
if it is required for code at this level (Derby internal). I do not want
to let the cache know too much about what is going on, as it's only there
to hold references for objects implementing the PreparedStatement
interface.
I plan to commit in a few days, and I also expect there will be another
patch with some more tests and the required changes for writing the
tests.
> JDBC statement cache implementation
> -----------------------------------
>
> Key: DERBY-3324
> URL: https://issues.apache.org/jira/browse/DERBY-3324
> Project: Derby
> Issue Type: Sub-task
> Components: Network Client
> Affects Versions: 10.4.0.0
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Priority: Minor
> Fix For: 10.4.0.0
>
> Attachments: derby-3324-1a-jdbc_statementcache.diff,
> derby-3324-1a-jdbc_statementcache.stat,
> derby-3324-1b-jdbc_statementcache.diff, derby-3324-1b-jdbc_statementcache.stat
>
>
> Implement a cache for storing JDBC prepared statement objects.
> The cache will be responsible for holding free prepared statement objects
> that can be reused, and also to throw away objects if the cache grows too big.
> All objects in the cache must belong to the same physical connection, but
> they can be reused across logical connections obtained from a single physical
> connection in a connection pool.
> This component is probably a candidate for code sharing between the client
> and the embedded driver. Sharing will not be part of this issue.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.