[ https://issues.apache.org/jira/browse/GEODE-2349?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Eric Shu resolved GEODE-2349. ----------------------------- Resolution: Duplicate Fix Version/s: 1.4.0 Duplicate of GEODE-3521. > 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 (v6.4.14#64029)