[
https://issues.apache.org/jira/browse/DERBY-2432?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503893
]
Knut Anders Hatlen commented on DERBY-2432:
-------------------------------------------
Hi Julo,
I have started reviewing the patch, but I haven't studied the entire patch in
detail yet. Here are some preliminary comments and questions:
XATransactionState.java:
- it would be good if the new methods had javadoc comments
- perhaps the common code in xa_rollback() and xa_commit() could be factored
out into a utility method, say cancelCancellationTask()?
- I think there is a possibility that CancelXATransactionTask tries to roll
back the transaction after an explicit rollback or commit has been issued. This
is because CancelXATransactionTask.run() and
XATransactionState.xa_commit()/xa_rollback() synchronize on different objects.
- would it be more natural to have CancelXATransactionTask as a non-static
class? Then we wouldn't need the tranState variable (it could be accessed with
XATransactionState.this).
- I'm not sure I understand why scheduleTimeoutTask() can be unsynchronized
whereas all the other methods require synchronization of some kind. Could you
please explain?
- if CancelXATransactionTask.run() catches an exception, it prints it to the
console. I'm not sure what's the best way to handle these exceptions, but I
don't think printing them is appropriate. Perhaps it would be better to use
Monitor.logMessage() (or perhaps create a Monitor.logThrowable() which could
print the stack trace)?
- XATransactionState.cancel() catches SQLException and re-throws it as
XAException. Do you think we could chain the exceptions with initCause() so
that we preserve the original error?
> Unimplemented transaction time out for XA transactions may cause that locks
> will not be released when client terminates outside a unit of work.
> -----------------------------------------------------------------------------------------------------------------------------------------------
>
> Key: DERBY-2432
> URL: https://issues.apache.org/jira/browse/DERBY-2432
> Project: Derby
> Issue Type: New Feature
> Components: JDBC
> Reporter: Julius Stroffek
> Assignee: Julius Stroffek
> Fix For: 10.3.0.0
>
> Attachments: d2432.diff, d2432.stat, description.txt
>
>
> The XAResource interface provides function setTransactionTimeout which is
> currently not supported in derby.
> When client application uses client driver to connect to derby database and
> the application crashes outside the unit of work of XA transaction and the
> transaction is not committed or rolled back yet the locks held by the
> transaction will not be released.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.