[JBoss JIRA] (JBTM-2426) XTS WSTFSC07-interop failure
by Gytis Trikleris (JIRA)
[ https://issues.jboss.org/browse/JBTM-2426?page=com.atlassian.jira.plugin.... ]
Gytis Trikleris commented on JBTM-2426:
---------------------------------------
The test was waiting for the timer to abort the transaction. However, since the timer failed with NPE, transaction was not aborted.
> XTS WSTFSC07-interop failure
> ----------------------------
>
> Key: JBTM-2426
> URL: https://issues.jboss.org/browse/JBTM-2426
> Project: JBoss Transaction Manager
> Issue Type: Bug
> Components: XTS
> Affects Versions: 5.1.1
> Reporter: Michael Musgrove
> Assignee: Gytis Trikleris
> Priority: Minor
> Fix For: 5.next
>
> Attachments: com.jboss.transaction.wstf.interop.Sc007Test-output.txt
>
>
> junit test failure:
> {code}
> Running com.jboss.transaction.wstf.interop.Sc007Test
> Tests run: 15, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: 326.369 sec <<< FAILURE!
> test3_10(com.jboss.transaction.wstf.interop.Sc007Test) Time elapsed: 212.002 sec <<< FAILURE!
> junit.framework.AssertionFailedError: Conversation did not complete successfully
> at junit.framework.Assert.fail(Assert.java:57)
> at junit.framework.Assert.assertTrue(Assert.java:22)
> at junit.framework.TestCase.assertTrue(TestCase.java:192)
> at com.jboss.transaction.wstf.interop.Sc007TestCase.test3_10(Sc007TestCase.java:474)
> at com.jboss.transaction.wstf.interop.Sc007Test.test3_10(Sc007Test.java:176)
> test3_11(com.jboss.transaction.wstf.interop.Sc007Test) Time elapsed: 1.608 sec <<< ERROR!
> com.arjuna.wst.TransactionRolledBackException: null
> at com.arjuna.wst11.stub.CompletionStub.commit(CompletionStub.java:65)
> at com.jboss.transaction.wstf.interop.Sc007TestCase.test3_11(Sc007TestCase.java:495)
> at com.jboss.transaction.wstf.interop.Sc007Test.test3_11(Sc007Test.java:181)
> Results :
> Failed tests:
> Sc007Test.test3_10:176 Conversation did not complete successfully
> Tests in error:
> Sc007Test.test3_11:181 » TransactionRolledBack
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 6 months
[JBoss JIRA] (JBTM-2426) XTS WSTFSC07-interop failure
by Gytis Trikleris (JIRA)
[ https://issues.jboss.org/browse/JBTM-2426?page=com.atlassian.jira.plugin.... ]
Gytis Trikleris commented on JBTM-2426:
---------------------------------------
This bit seems a bit fishy:
{code}
[0m[31m16:25:51,559 ERROR [stderr] (Timer-2) Exception in thread "Timer-2" java.lang.NullPointerException
[0m[31m16:25:51,559 ERROR [stderr] (Timer-2) at com.arjuna.wst11.messaging.engines.CoordinatorEngine.sendPrepare(CoordinatorEngine.java:603)
[0m[31m16:25:51,560 ERROR [stderr] (Timer-2) at com.arjuna.wst11.messaging.engines.CoordinatorEngine.commsTimeout(CoordinatorEngine.java:438)
[0m[31m16:25:51,560 ERROR [stderr] (Timer-2) at com.arjuna.wst11.messaging.engines.CoordinatorEngine.access$000(CoordinatorEngine.java:28)
[0m[31m16:25:51,560 ERROR [stderr] (Timer-2) at com.arjuna.wst11.messaging.engines.CoordinatorEngine$1.run(CoordinatorEngine.java:715)
[0m[31m16:25:51,560 ERROR [stderr] (Timer-2) at java.util.TimerThread.mainLoop(Timer.java:555)
[0m[31m16:25:51,560 ERROR [stderr] (Timer-2) at java.util.TimerThread.run(Timer.java:505)
{code}
All the logged warnings and errors before this also appear in the successful logs. However, after this NPE unexpected errors appear.
> XTS WSTFSC07-interop failure
> ----------------------------
>
> Key: JBTM-2426
> URL: https://issues.jboss.org/browse/JBTM-2426
> Project: JBoss Transaction Manager
> Issue Type: Bug
> Components: XTS
> Affects Versions: 5.1.1
> Reporter: Michael Musgrove
> Assignee: Gytis Trikleris
> Priority: Minor
> Fix For: 5.next
>
> Attachments: com.jboss.transaction.wstf.interop.Sc007Test-output.txt
>
>
> junit test failure:
> {code}
> Running com.jboss.transaction.wstf.interop.Sc007Test
> Tests run: 15, Failures: 1, Errors: 1, Skipped: 0, Time elapsed: 326.369 sec <<< FAILURE!
> test3_10(com.jboss.transaction.wstf.interop.Sc007Test) Time elapsed: 212.002 sec <<< FAILURE!
> junit.framework.AssertionFailedError: Conversation did not complete successfully
> at junit.framework.Assert.fail(Assert.java:57)
> at junit.framework.Assert.assertTrue(Assert.java:22)
> at junit.framework.TestCase.assertTrue(TestCase.java:192)
> at com.jboss.transaction.wstf.interop.Sc007TestCase.test3_10(Sc007TestCase.java:474)
> at com.jboss.transaction.wstf.interop.Sc007Test.test3_10(Sc007Test.java:176)
> test3_11(com.jboss.transaction.wstf.interop.Sc007Test) Time elapsed: 1.608 sec <<< ERROR!
> com.arjuna.wst.TransactionRolledBackException: null
> at com.arjuna.wst11.stub.CompletionStub.commit(CompletionStub.java:65)
> at com.jboss.transaction.wstf.interop.Sc007TestCase.test3_11(Sc007TestCase.java:495)
> at com.jboss.transaction.wstf.interop.Sc007Test.test3_11(Sc007Test.java:181)
> Results :
> Failed tests:
> Sc007Test.test3_10:176 Conversation did not complete successfully
> Tests in error:
> Sc007Test.test3_11:181 » TransactionRolledBack
> {code}
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 6 months
[JBoss JIRA] (JBTM-2458) Think of the possibility to improve Compensations API with lambdas
by Gytis Trikleris (JIRA)
[ https://issues.jboss.org/browse/JBTM-2458?page=com.atlassian.jira.plugin.... ]
Gytis Trikleris edited comment on JBTM-2458 at 7/13/15 5:37 AM:
----------------------------------------------------------------
First example:
{code}
public class BankingService {
@Inject
private AccountManager accountManager;
@Compensatable
public void transferMoney(String fromAccount, String toAccount, Double amount) {
accountManager.debitAccount(fromAccount, amount);
accountManager.creditAccount(toAccount, amount);
}
}
@Compensatable
public class AccountManager {
private static final String DATABASE_NAME = "accounts-database";
private static final String COLLECTION_NAME = "accounts-collection";
@Inject(db = DATABASE_NAME, collection = COLLECTION_NAME)
private MongoCollection collection;
public void creditAccount(String account, Double amount) {
Document filter = new Document("name", account);
Document update = new Document("$inc", amount);
Document undo = new Document("$inc", -1 * amount);
updateCollection(filter, update, undo);
}
public void debitAccount(String account, Double amount) {
Document filter = new Document("name", account);
Document update = new Document("$inc", -1 * amount);
Document undo = new Document("$inc", amount);
updateCollection(filter, update, undo);
}
private void updateCollection(Document filter, Document update, Document undo) {
CompensationHandler compensationHandler = () -> collection.updateOne(filter, undo);
ConfirmationHandler confirmationHandler = () -> System.out.println(filter + " was updated");
// v1
collection.onFailure(compensationHandler).onSuccess(confirmationHandler).updateOne(filter, update);
// v2
// collection.updateOne(filter, update, compensationHandler, confirmationHandler);
}
}
{code}
was (Author: gytis):
My first example:
{code}
public class BankingService {
@Inject
private AccountManager accountManager;
@Compensatable
public void transferMoney(String fromAccount, String toAccount, Double amount) {
accountManager.debitAccount(fromAccount, amount);
accountManager.creditAccount(toAccount, amount);
}
}
@Compensatable
public class AccountManager {
private static final String DATABASE_NAME = "accounts-database";
private static final String COLLECTION_NAME = "accounts-collection";
@Inject(db = DATABASE_NAME, collection = COLLECTION_NAME)
private MongoCollection collection;
public void creditAccount(String account, Double amount) {
Document filter = new Document("name", account);
Document update = new Document("$inc", amount);
Document undo = new Document("$inc", -1 * amount);
updateCollection(filter, update, undo);
}
public void debitAccount(String account, Double amount) {
Document filter = new Document("name", account);
Document update = new Document("$inc", -1 * amount);
Document undo = new Document("$inc", amount);
updateCollection(filter, update, undo);
}
private void updateCollection(Document filter, Document update, Document undo) {
CompensationHandler compensationHandler = () -> collection.updateOne(filter, undo);
ConfirmationHandler confirmationHandler = () -> System.out.println(filter + " was updated");
// v1
collection.onFailure(compensationHandler).onSuccess(confirmationHandler).updateOne(filter, update);
// v2
// collection.updateOne(filter, update, compensationHandler, confirmationHandler);
}
}
{code}
> Think of the possibility to improve Compensations API with lambdas
> ------------------------------------------------------------------
>
> Key: JBTM-2458
> URL: https://issues.jboss.org/browse/JBTM-2458
> Project: JBoss Transaction Manager
> Issue Type: Task
> Components: TXFramework
> Reporter: Gytis Trikleris
> Assignee: Gytis Trikleris
> Fix For: 5.next
>
>
> Emmanuel suggested to reduce verbosity in Compensations API by making it possible to use lambdas for handler implementation.
> We should try to think of the best API changes to introduce that.
> We could rewrite MongoDB quickstart to make it easier to visualise the difference.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 6 months
[JBoss JIRA] (JBTM-2458) Think of the possibility to improve Compensations API with lambdas
by Gytis Trikleris (JIRA)
[ https://issues.jboss.org/browse/JBTM-2458?page=com.atlassian.jira.plugin.... ]
Gytis Trikleris commented on JBTM-2458:
---------------------------------------
My first example:
{code}
public class BankingService {
@Inject
private AccountManager accountManager;
@Compensatable
public void transferMoney(String fromAccount, String toAccount, Double amount) {
accountManager.debitAccount(fromAccount, amount);
accountManager.creditAccount(toAccount, amount);
}
}
@Compensatable
public class AccountManager {
private static final String DATABASE_NAME = "accounts-database";
private static final String COLLECTION_NAME = "accounts-collection";
@Inject(db = DATABASE_NAME, collection = COLLECTION_NAME)
private MongoCollection collection;
public void creditAccount(String account, Double amount) {
Document filter = new Document("name", account);
Document update = new Document("$inc", amount);
Document undo = new Document("$inc", -1 * amount);
updateCollection(filter, update, undo);
}
public void debitAccount(String account, Double amount) {
Document filter = new Document("name", account);
Document update = new Document("$inc", -1 * amount);
Document undo = new Document("$inc", amount);
updateCollection(filter, update, undo);
}
private void updateCollection(Document filter, Document update, Document undo) {
CompensationHandler compensationHandler = () -> collection.updateOne(filter, undo);
ConfirmationHandler confirmationHandler = () -> System.out.println(filter + " was updated");
// v1
collection.onFailure(compensationHandler).onSuccess(confirmationHandler).updateOne(filter, update);
// v2
// collection.updateOne(filter, update, compensationHandler, confirmationHandler);
}
}
{code}
> Think of the possibility to improve Compensations API with lambdas
> ------------------------------------------------------------------
>
> Key: JBTM-2458
> URL: https://issues.jboss.org/browse/JBTM-2458
> Project: JBoss Transaction Manager
> Issue Type: Task
> Components: TXFramework
> Reporter: Gytis Trikleris
> Assignee: Gytis Trikleris
> Fix For: 5.next
>
>
> Emmanuel suggested to reduce verbosity in Compensations API by making it possible to use lambdas for handler implementation.
> We should try to think of the best API changes to introduce that.
> We could rewrite MongoDB quickstart to make it easier to visualise the difference.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 6 months
[JBoss JIRA] (JBTM-2458) Think of the possibility to improve Compensations API with lambdas
by Gytis Trikleris (JIRA)
[ https://issues.jboss.org/browse/JBTM-2458?page=com.atlassian.jira.plugin.... ]
Gytis Trikleris updated JBTM-2458:
----------------------------------
Description:
Emmanuel suggested to reduce verbosity in Compensations API by making it possible to use lambdas for handler implementation.
We should try to think of the best API changes to introduce that.
We could rewrite MongoDB quickstart to make it easier to visualise the difference.
> Think of the possibility to improve Compensations API with lambdas
> ------------------------------------------------------------------
>
> Key: JBTM-2458
> URL: https://issues.jboss.org/browse/JBTM-2458
> Project: JBoss Transaction Manager
> Issue Type: Task
> Components: TXFramework
> Reporter: Gytis Trikleris
> Assignee: Gytis Trikleris
> Fix For: 5.next
>
>
> Emmanuel suggested to reduce verbosity in Compensations API by making it possible to use lambdas for handler implementation.
> We should try to think of the best API changes to introduce that.
> We could rewrite MongoDB quickstart to make it easier to visualise the difference.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
9 years, 6 months