You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@geode.apache.org by GitBox <gi...@apache.org> on 2020/09/11 09:06:00 UTC

[GitHub] [geode-native] alb3rtobr commented on pull request #648: GEODE-8480: Add txmanager check in tx example

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:
users@infra.apache.org