[ 
https://issues.apache.org/jira/browse/GEODE-8480?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17194116#comment-17194116
 ] 

ASF GitHub Bot commented on GEODE-8480:
---------------------------------------

alb3rtobr commented on pull request #648:
URL: https://github.com/apache/geode-native/pull/648#issuecomment-690971310


   I was running a test consisting on killing a Geode server while a C++ client 
with several threads was executing transactions. I observed that most of the 
times, the client died after killing the server with following error in logs:
   ```
   [error 2020/09/01 10:31:05.977905 CEST alb3rtobr-XPS:7395 139697166743296] 
Unexpected exception during completing transaction : illegal State
   terminate called after throwing an instance of 
'apache::geode::client::Exception'
   terminate called recursively
     what():  : illegal State
   ```
   
   I was not sure about what was happening, but I had the feeling that I was 
doing something wrong, because I would not expect that the client was dying in 
this scenario. When I was taking a look at the transaction page in the Geode 
documentation, I realized that in Java, the transaction example includes the 
call to the `exists()` method ([link to the 
doc](https://geode.apache.org/docs/guide/112/developing/transactions/directed_example.html))
 before performing rollback.
   
   ```
   if(txManager.exists()) {
       txManager.rollback();
   }     
   ```
   I added the call to the function to my C++ client and the problem was 
solved. After that the client was showing some exceptions when one of the 
server was killed, but the client was not dying. So I felt that calling to this 
`exists()`method was something to be done in transactions and that it was 
missing from the C++ documentation.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


> Add tx manager check in geode-native transaction example
> --------------------------------------------------------
>
>                 Key: GEODE-8480
>                 URL: https://issues.apache.org/jira/browse/GEODE-8480
>             Project: Geode
>          Issue Type: Improvement
>          Components: docs, native client
>            Reporter: Alberto Bustamante Reyes
>            Assignee: Alberto Bustamante Reyes
>            Priority: Minor
>              Labels: pull-request-available
>
> Transactions documentation & example in the geode C++ client is not checking 
> if the transaction manager exists before calling to rollback, as it is done 
> in the transactions documentation and example in geode.
> I have seen that depending on the exception, the rollback can generate an 
> error so I think its something that should be added to the example.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to