You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Julius Stroffek (JIRA)" <ji...@apache.org> on 2007/04/02 16:18:32 UTC

[jira] Created: (DERBY-2508) Implement the XA transaction support for embedded driver.

Implement the XA transaction support for embedded driver.
---------------------------------------------------------

                 Key: DERBY-2508
                 URL: https://issues.apache.org/jira/browse/DERBY-2508
             Project: Derby
          Issue Type: Sub-task
    Affects Versions: 10.2.2.0
            Reporter: Julius Stroffek
         Assigned To: Julius Stroffek
             Fix For: 10.3.0.0


Implement the XA transaction support for embedded driver in EmbedXAResource.

Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2508:
-----------------------------------

    Derby Info: [Patch Available]

The patch is available at the parent task.

> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>          Components: JDBC
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>            Assignee: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat, d2508_try2.diff, d2508_try2.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2508:
-----------------------------------

    Derby Info: [Patch Available]

> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493367 ] 

Julius Stroffek commented on DERBY-2508:
----------------------------------------

Dan, I am sorry, I forgot to explain that. I was also not able to find anything in JDBC/JTA spec except a small piece in XAResource.get/setTransactionTimeout javadoc.
---

The xa transaction timeout can by set up by calling XAResource.setTransactionTimeout, if the value 0 is specified (or the setTransactionTimout function was not called for the XAResource instance) the value of transaction timeout is the database default.

The database default value of xa transaction timeout can be specified in derby.jdbc.xaTransactionTimeout system property. The value of timeout is in seconds and if it is equal to 0 the transaction timeout feature is disabled.The default value of default xa transaction timeout is currently 300 seconds. I think that this might/should be changed to 0 because this would be consistent with a previous behavior (no xa transaction timeout).

The timeout is measured since the application calls the XAResource.start method until XAResource.commit/rollback is called. It does not matter whether the transaction is later associated or not associated with any XAResource.

Once a transaction is rolled back due to timing out all the knowledge of the global transaction is discarded. If it was associated with some XAResource instance, it would be disassociated. If there was a running statement it would be canceled and the exception (SQLState.LANG_STATEMENT_CANCELLED_OR_TIMED_OUT) would be thrown to the application.

An option would be to roll back the transaction when it times out and remember that transaction for a while and throw the timeout related exceptions to the client and do the final cleanup after some time. This might help when identifying a timeout related issues on a client.

Please, feel free to give any comments or suggestions to the behavior or implementation.


> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493417 ] 

Daniel John Debrunner commented on DERBY-2508:
----------------------------------------------

> The timeout is measured since the application calls the XAResource.start 

Does this mean just XAResource.start(TMNOFLAGS) or is the timer reset on each call to start?

> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493422 ] 

Julius Stroffek commented on DERBY-2508:
----------------------------------------

> Does this mean just XAResource.start(TMNOFLAGS) or is the timer reset on each call to start?

Just the first call, so only for XAResource.start(TMNOFLAGS).

> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek closed DERBY-2508.
----------------------------------

    Resolution: Fixed
    Derby Info:   (was: [Patch Available])

> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>          Components: JDBC
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>            Assignee: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat, d2508_try2.diff, d2508_try2.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493531 ] 

Julius Stroffek commented on DERBY-2508:
----------------------------------------

suites.All and derbyall finished without errors or failures.

> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat, d2508_try2.diff, d2508_try2.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493409 ] 

Daniel John Debrunner commented on DERBY-2508:
----------------------------------------------

Thanks for the explantion.

One intial thought is why have the property? There exists a standard api for setting the transaction timeout, why add another non-standard mechanism?

> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2508:
-----------------------------------

    Attachment: d2508_try2.stat
                d2508_try2.diff

I found a bug in a patch - there should be a condition tested (timoutTask != null) in XATransactionState.xa_commit/rollback before executing a code to cancel that timeoutTask.

I also changed a value of default xa transaction timeout to 0 to disable the timeout by default.

I am attaching a patch with a fix. Currently, I am running the tests.

> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat, d2508_try2.diff, d2508_try2.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2508:
-----------------------------------

    Derby Info:   (was: [Patch Available])

I'll change the behaviour of  XAResource.setTransactionTimeout/getTransactionTimeout because DRDA protocol is lacking these features and allows specifying the transaction timeout in SYNCCTL codepoint corresponding to the XAREsource.start function call.

> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>          Components: JDBC
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat, d2508_try2.diff, d2508_try2.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2508) Implement the XA transaction support for embedded driver.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2508:
-----------------------------------

    Attachment: d2432_beta1.stat
                d2432_beta1.diff

I have created a some patch for this issue.

I used Monitor.getMonitor().getTimerFactory().getCancellationTimer() to fire the cancellation event. The time is measured from the transaction start (invoking XAResource.start() method) with the corresponding Xid.

The cancellation task is called with the instances of the corresponding XATransactionState and EmbedXAResource where the transaction was started. After the cancellation event is fired the transaction state is checked. If the transaction is still associated with the same EmbedXAResource instance it is disassociated first. If the transaction is associated with the different XAResource instance we will wait for the transaction to be disassociated first.

---
Currently, I have the following problems/questions:

When the transaction is still associated with any resource there might be some running queries. How can I safely cancel those running queries (of course from different thread)? Is there any mechanism for that?

Currently, when the cancellation event finishes derby does not know anything about the transaction and all the exceptions thrown after that are like the transaction was never known before. It might be difficult for the user to find out what is going on. Would it make sense to perform the cancellation in two phases. First phase would rollback the transaction but would not remove the transaction state from the global transaction table. This would happen in the second phase. However a new cancellation task would be required for this.

I ran derbyall and Suites.All without failures.

I appreciate any comments.

> Implement the XA transaction support for embedded driver.
> ---------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Mike Matrigali (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mike Matrigali updated DERBY-2508:
----------------------------------

    Component/s: JDBC

> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>          Components: JDBC
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat, d2508_try2.diff, d2508_try2.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Daniel John Debrunner updated DERBY-2508:
-----------------------------------------

    Summary: Implement the XA transaction timeout support for embedded driver.  (was: Implement the XA transaction support for embedded driver.)

Just clarify the summary in-case this bug gets listed by itself anywhere.

> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493421 ] 

Julius Stroffek commented on DERBY-2508:
----------------------------------------

XAResource.setTransactionTimeout says something about the resource manager's default timeout. This should than have some fixed value (or 0 to be disabled).

If derby is used as an embedded database the feature is probably of a limited value and using XAResource.setTransactionTimeout might be sufficient. I thought that the database administrator might want to change this if derby will run as a network server. It might help in case of a network server - the db administrator do not have to be able to control the application code and even he do not have to know every application connecting to the database.

If the application connecting to derby server will not use setTransactionTimeout itself and it will crash when there is some global transaction not commited/rolled back which is also not associated to any connection, that global transaction will keep holding the locks. DB administrator is than able to setup the derby.jdbc.xaTransactionTimeout property and the locks would be released after the specified time.

And I thought that it would be a good idea that the behavior of derby network client end embedded client would be the same.


> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Daniel John Debrunner (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12493153 ] 

Daniel John Debrunner commented on DERBY-2508:
----------------------------------------------

Is there an overview of how this functionality behaves?
I couldn't see anything in this issue and JDBC/JTA specs don't seem to specifiy how the timeout is used.

> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (DERBY-2508) Implement the XA transaction timeout support for embedded driver.

Posted by "Julius Stroffek (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/DERBY-2508?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Julius Stroffek updated DERBY-2508:
-----------------------------------

    Attachment: d2508.stat
                d2508.diff

I am attaching a patch that solves also the problem of the currently running statement. A brief explanation of changes in classes follows.

I ran derbyall and suites.All without failures.

Please review the patch. Any comments or suggestions are welcomed.

====================
The cancelation task is driven/maintaned in XATransactionState class instance.

A brief explanation of changes in classes:

EmbedConnection:
---
Comments to xa_rollback/commit/prepare added stating that these functions should
not be called directly but XATransactionState.xa_rollback/commit/prepare should
be called instead because these do also timer task maintanance/cancallation.

cancelRunningStatement - added a method to cancel the current running statement.

EmbedXAResource:
---
calling XATransactionState.xa_rollback/commit/prepare instead
of XATransactionState.conn.xa_rollback/commit/prepare. The new methods call
the original methods and also some more code related to timeouts was added.

returnConnectionToResource, removeXATransaction - changed the visibility
	to package because we have to call the functions from XATransactionState
	to perform correct global transaction disassociation.

set/getTransactionTimout - code added to support the transaction timeout.

start - A scheduling of a cancellation task was added.

XATransactionState:
---
CancelXATransactionTask class - added and represents a timeout task to be
	executed.

xa_rollback/commit/prepare - wrap calls to conn.xa_rollback/commit/prepare
	and contain timout task maintanance/cancellation code.

scheduleTimeoutTask - method added to schedule a timout task.

Property:
---
derby.jdbc.xaTransactionTimeout - new property added which sets up the default
	value for XA transaction timeout.

XATransactionTest:
---
Added a test for XA transaction timeout behaviour in different stages/states of
a global transaction including cancellation of a running statement.



> Implement the XA transaction timeout support for embedded driver.
> -----------------------------------------------------------------
>
>                 Key: DERBY-2508
>                 URL: https://issues.apache.org/jira/browse/DERBY-2508
>             Project: Derby
>          Issue Type: Sub-task
>    Affects Versions: 10.2.2.0
>            Reporter: Julius Stroffek
>         Assigned To: Julius Stroffek
>             Fix For: 10.3.0.0
>
>         Attachments: d2432_beta1.diff, d2432_beta1.stat, d2508.diff, d2508.stat
>
>
> Implement the XA transaction support for embedded driver in EmbedXAResource.
> Implement functions XAResource.setTransactionTimeout and XAResource.getTransactionTimeout and add the code to cancel the transaction after the specified period of time.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.