You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@geode.apache.org by "Swapnil Bawaskar (JIRA)" <ji...@apache.org> on 2018/02/01 22:52:55 UTC

[jira] [Closed] (GEODE-2349) Region.values() doesn't work properly inside JTA

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

Swapnil Bawaskar closed GEODE-2349.
-----------------------------------

> Region.values() doesn't work properly inside JTA
> ------------------------------------------------
>
>                 Key: GEODE-2349
>                 URL: https://issues.apache.org/jira/browse/GEODE-2349
>             Project: Geode
>          Issue Type: Bug
>          Components: transactions
>            Reporter: Vadim Lotarev
>            Assignee: Eric Shu
>            Priority: Major
>             Fix For: 1.4.0
>
>
> I experienced rather strange error invoking Region.values() within JTA transaction: {{java.lang.IllegalStateException: The Region collection is not transactional but is being used in a transaction}}.
> Doing some investigation I think I understand what is the cause of this error. Everything works if {{Region.values()}} invoked alone in transaction but failed if you invoke, say, {{get()}} on another (or the same) region before starting iteration over the collection returned by {{values()}}. I think that the reason of this error is the absence of {{discoverJTA()}} in {{values()}} method. So, when {{values()}} invoked first time {{EntriesSet}} is created with {{myTX = null}} since no transaction is determined (as soon as {{discoverJTA()}} is not invoked). If you are iterating immediately everything works as soon as there are no transaction on a region still ({{EntriesSet.myTx = null && topRegion.isTX() = false}}). But as soon as you invoke {{get()}} (or any other method where {{discoverJTA()}} is invoked) than all regions became transactional and next execution of {{EntriesSet.iterator()}} failed ({{EntriesSet.myTx = null && topRegion.isTX() = true}}).



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)