[ 
https://issues.apache.org/jira/browse/IGNITE-23541?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Julia Bakulina updated IGNITE-23541:
------------------------------------
    Description: 
It will be useful to add the info to the docs that the checks below are not 
equivalent and for some cases the 2nd check should be chosen.
{code:java}
1) IgniteTxManager#checkEmptyTransactions(){code}
{code:java}
2) ctx.grid().transactions().tx() != null;{code}
The reason is that GridCacheMvccManager#pendingExplicit contains the mapping of 
Thread ID to value using IgniteTxManager#checkEmptyTransactions.

[https://github.com/apache/ignite/blob/afe24bed52ba4071b1b7d846947c325e4e4e518b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java#L912]

_________________

If to replace  

/** {@inheritDoc} */
@Override public void clear() throws IgniteCheckedException {
if (ctx.transactional()) {
ctx.tm().checkEmptyTransactions(() ->
format(String.format(NON_TRANSACTIONAL_IGNITE_CACHE_CLEAR_IN_TX_ERROR_MESSAGE)));
}

clear((Set<? extends K>)null);
}{code}
 

  was:
It will be useful to add the info to the docs that the checks below are not 
equivalent and for some cases the 2nd check should be chosen.
{code:java}
1) IgniteTxManager#checkEmptyTransactions(){code}
{code:java}
2) ctx.grid().transactions().tx() != null;{code}
The reason is that GridCacheMvccManager#pendingExplicit contains the mapping of 
Thread ID to value using IgniteTxManager#checkEmptyTransactions.

[https://github.com/apache/ignite/blob/afe24bed52ba4071b1b7d846947c325e4e4e518b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java#L912]


> Extend description of IgniteTxManager#checkEmptyTransactions()
> --------------------------------------------------------------
>
>                 Key: IGNITE-23541
>                 URL: https://issues.apache.org/jira/browse/IGNITE-23541
>             Project: Ignite
>          Issue Type: Task
>            Reporter: Julia Bakulina
>            Assignee: Julia Bakulina
>            Priority: Minor
>              Labels: ise
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> It will be useful to add the info to the docs that the checks below are not 
> equivalent and for some cases the 2nd check should be chosen.
> {code:java}
> 1) IgniteTxManager#checkEmptyTransactions(){code}
> {code:java}
> 2) ctx.grid().transactions().tx() != null;{code}
> The reason is that GridCacheMvccManager#pendingExplicit contains the mapping 
> of Thread ID to value using IgniteTxManager#checkEmptyTransactions.
> [https://github.com/apache/ignite/blob/afe24bed52ba4071b1b7d846947c325e4e4e518b/modules/core/src/main/java/org/apache/ignite/internal/processors/cache/GridCacheMvccManager.java#L912]
> _________________
> If to replace  
> /** {@inheritDoc} */
> @Override public void clear() throws IgniteCheckedException {
> if (ctx.transactional()) {
> ctx.tm().checkEmptyTransactions(() ->
> format(String.format(NON_TRANSACTIONAL_IGNITE_CACHE_CLEAR_IN_TX_ERROR_MESSAGE)));
> }
> clear((Set<? extends K>)null);
> }{code}
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to