[
https://issues.apache.org/jira/browse/DERBY-3457?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kristian Waagan updated DERBY-3457:
-----------------------------------
Attachment: derby-3457-1c-stmt_closing.diff
'derby-3457-1c-stmt_closing.diff' adds the closing logic for logical statements.
The basic approach taken is that each new logical statement is registered by
the StatementCacheInteractor.
When a logical statement is explicitly closed, it removes itself from the list
of open statements.
When the caching logical connection is closed, it iterates through the list of
open statements and closes them.
Possible issues:
a) What should happen if closing a statement throws exception?
Currently, the close procedure is aborted, and I'm not quite sure what
state the connection is left in.
The close can fail on statement reset, or on physical statement close. Not
sure which errors can occur, except for network problems.
There is also a possible issue with calling super.close in
CachingLogicalConnection. That method cannot close open statements when called
from a CLC, but it should do it when called on a LogicalConnection. This
suggests a bug somewhere, and I have to look into this to determine if the
existing LogicalConnection has a bug, or if it is the new code I have added.
Patch 1d ready for review.
> Closing a logical connection must close all associated logical statements
> -------------------------------------------------------------------------
>
> Key: DERBY-3457
> URL: https://issues.apache.org/jira/browse/DERBY-3457
> Project: Derby
> Issue Type: Task
> Components: JDBC, Network Client
> Affects Versions: 10.4.0.0
> Environment: Client-server with statement pooling enabled in the
> client driver.
> Reporter: Kristian Waagan
> Assignee: Kristian Waagan
> Fix For: 10.4.0.0
>
> Attachments: derby-3457-1a-stmt_closing.diff,
> derby-3457-1a-stmt_closing.stat, derby-3457-1b-stmt_closing.diff,
> derby-3457-1c-stmt_closing.diff, derby-3457-2a-stmt_registration.diff
>
>
> When a logical connection is closed, all open logical statements created by
> this connection must be closed.
> The closing is important per the general principle of cleaning up resources,
> but especially so in the case of statement pooling, as not closing the
> logical statement can cause side effects on another logical connection
> (sharing the same physical connection).
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.