[
https://issues.apache.org/jira/browse/IGNITE-19663?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Evgeny Stanilovsky updated IGNITE-19663:
----------------------------------------
Description:
Sql layer can raise transaction implicitly if no explicit is supplied,
tx.(rollback|commit) methods for appropriate implicit tx may be untouched due
to bug.
Check
{noformat}SqlQueryProcessor#querySingle0{noformat}
the only call for implicit tx.
For now there are huge number of tests (for example
ItSqlAsynchronousApiTest#implicitTransactionsStates) that use reflection for
detection transaction completeness. This is erroneous way. So required *test
only* functionality that can shows call difference between
TxManager.begin(*boolean*) and Transaction.(commit|rollback).
Another words: required functionality that detects that no transactions without
*Transaction.(commit|rollback)* call are present in appropriate TxManager.
Pseudo code, as i can see it
{noformat}
TxManager txManagerInstance = ... (so this is a questionable how can we get it
without reflection)
tx = txManagerInstance.begin(RW or RO);
...
some code, probably sql corner cases...
call_sql_operation_with_EXPLICIT_tx(tx, ...);
tx.commit();
call_sql_operation_with_IMPLICIT_tx(null, ...); (tx will burn and finalize
internally)
....
assertTrue(txManagerInstance.no_transactions_without_commit_or_rollback_call())
{noformat}
was:
Sql layer can raise transaction implicitly if no explicit is supplied,
tx.(rollback|commit) methods for appropriate implicit tx may be untouched due
to bug.
Check SqlQueryProcessor#querySingle0 the only call for implicit tx.
For now there are huge number of tests (for example
ItSqlAsynchronousApiTest#implicitTransactionsStates) that use reflection for
detection transaction completeness. This is erroneous way. So required *test
only* functionality that can shows call difference between
TxManager.begin(*boolean*) and Transaction.(commit|rollback).
Another words: required functionality that detects that no transactions without
*Transaction.(commit|rollback)* call are present in appropriate TxManager.
Pseudo code, as i can see it
{noformat}
TxManager txManagerInstance = ... (so this is a questionable how can we get it
without reflection)
tx = txManagerInstance.begin(RW or RO);
...
some code, probably sql corner cases...
call_sql_operation_with_EXPLICIT_tx(tx, ...);
tx.commit();
call_sql_operation_with_IMPLICIT_tx(null, ...); (tx will burn and finalize
internally)
....
assertTrue(txManagerInstance.no_transactions_without_commit_or_rollback_call())
{noformat}
> Add possibility to check transaction state for test only purpose.
> -----------------------------------------------------------------
>
> Key: IGNITE-19663
> URL: https://issues.apache.org/jira/browse/IGNITE-19663
> Project: Ignite
> Issue Type: Wish
> Components: general
> Affects Versions: 3.0.0-beta1
> Reporter: Evgeny Stanilovsky
> Priority: Major
> Labels: ignite-3
>
> Sql layer can raise transaction implicitly if no explicit is supplied,
> tx.(rollback|commit) methods for appropriate implicit tx may be untouched due
> to bug.
> Check
> {noformat}SqlQueryProcessor#querySingle0{noformat}
> the only call for implicit tx.
> For now there are huge number of tests (for example
> ItSqlAsynchronousApiTest#implicitTransactionsStates) that use reflection for
> detection transaction completeness. This is erroneous way. So required *test
> only* functionality that can shows call difference between
> TxManager.begin(*boolean*) and Transaction.(commit|rollback).
> Another words: required functionality that detects that no transactions
> without *Transaction.(commit|rollback)* call are present in appropriate
> TxManager.
> Pseudo code, as i can see it
> {noformat}
> TxManager txManagerInstance = ... (so this is a questionable how can we get
> it without reflection)
> tx = txManagerInstance.begin(RW or RO);
> ...
> some code, probably sql corner cases...
> call_sql_operation_with_EXPLICIT_tx(tx, ...);
> tx.commit();
> call_sql_operation_with_IMPLICIT_tx(null, ...); (tx will burn and finalize
> internally)
> ....
> assertTrue(txManagerInstance.no_transactions_without_commit_or_rollback_call())
> {noformat}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)