[
https://issues.apache.org/jira/browse/TEPHRA-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16162615#comment-16162615
]
ASF GitHub Bot commented on TEPHRA-240:
---------------------------------------
Github user poornachandra commented on a diff in the pull request:
https://github.com/apache/incubator-tephra/pull/47#discussion_r138237949
--- Diff:
tephra-api/src/main/java/org/apache/tephra/TransactionConflictException.java ---
@@ -22,11 +22,50 @@
* Thrown to indicate transaction conflict occurred when trying to commit
a transaction.
*/
public class TransactionConflictException extends
TransactionFailureException {
+
+ /**
+ * @deprecated since 0.13-incubating. Use {@link
#TransactionConflictException(long, String, String)} instead.
+ */
+ @Deprecated
public TransactionConflictException(String message) {
super(message);
+ transactionId = null;
+ conflictingChange = null;
+ conflictingClient = null;
}
+ /**
+ * @deprecated since 0.13-incubating. Use {@link
#TransactionConflictException(long, String, String)} instead.
+ */
+ @Deprecated
public TransactionConflictException(String message, Throwable cause) {
super(message, cause);
+ transactionId = null;
+ conflictingChange = null;
+ conflictingClient = null;
+ }
+
+ public TransactionConflictException(long transactionId, String
conflictingChange, String conflictingClient) {
+ super(String.format("Transaction %d conflicts with %s on change key
'%s'", transactionId,
+ conflictingClient == null ? "unknown client" :
conflictingClient, conflictingChange));
+ this.transactionId = transactionId;
+ this.conflictingChange = conflictingChange;
+ this.conflictingClient = conflictingClient;
+ }
+
+ private final Long transactionId;
--- End diff --
It would be good if the fields are defined before the constructor
definitions.
> TransactionConflictException should contain the conflicting key and client id
> -----------------------------------------------------------------------------
>
> Key: TEPHRA-240
> URL: https://issues.apache.org/jira/browse/TEPHRA-240
> Project: Tephra
> Issue Type: Bug
> Reporter: Andreas Neumann
> Assignee: Andreas Neumann
> Fix For: 0.13.0-incubating
>
>
> Often transaction conflicts are hard to explain. Having the conflicting key,
> or even the name of the client that performed the concurrent update would
> greatly help debug.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)