[
https://issues.apache.org/jira/browse/DERBY-3446?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kristian Waagan updated DERBY-3446:
-----------------------------------
Attachment: derby-3446-2a_rs_getstatement_alternative.stat
derby-3446-2a_rs_getstatement_alternative.diff
Thanks for looking at the patch Knut Anders.
I think you are correct about the volatile, I will remove it if we end with
that approach.
I like the alternative approach, but I couldn't implement it exactly as you
suggest. Have I misunderstood?
LogicalStatementEntity does not implement java.sql.Statement, and can't be set
as the owner. A solution would be to move the setting of the ownership into
the subclasses, which would currently also only need to happen once due to the
class hierarchy (in LogicalPreparedStatement).
The other thing that changes, is that the physical statement now has a
reference to the logical statement. This could stop the most recently used
logical statement from being garbage collected, which is not a big deal I
believe. However, I'm wondering if there are other scenarios where this
reference could cause side effects / problems?
I added a reset of the owner to LogicalStatementEntity.close.
I also moved the tests to lang.ResultSetsFromPreparedStatementTest, to have the
code tested for other JVM versions than Java SE 6 as well.
Have a look at patch (2a) and comment / change it if you want to. I think I
like approach 2 better.
> Make ResultSet.getStatemet return the correct statement when created by a
> logical statement
> -------------------------------------------------------------------------------------------
>
> Key: DERBY-3446
> URL: https://issues.apache.org/jira/browse/DERBY-3446
> Project: Derby
> Issue Type: 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-3446-1a_rs_getstatement.diff,
> derby-3446-1a_rs_getstatement.stat,
> derby-3446-2a_rs_getstatement_alternative.diff,
> derby-3446-2a_rs_getstatement_alternative.stat
>
>
> ResultSet.getStatement must return the correct statement, that is the
> statement that created the result set.
> It is particularly important for result set created by logical statements, as
> leaking of physical statements can cause all kinds of side effects in a
> connection pooling environment.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.