Search code examples
ignite

ignite shutdown node while putting in transaction


I'm trying Apache Ignite and play with examples. I took an example from screencast about transactions. Started 3 server nodes, and start code that begins transaction and putting 50k elements in cache. While it running i kill 2 of 3 nodes. I expected Ignite to fail commit with error, but in fact there were no any errors and I get partially saved data. It is no fully ACID transaction as said in manuals. May be I don't understand something important?


Solution

  • Transactions are thread-local. This means that to enlist a cache operation into transaction, it has to be executed by the same thread that started the transaction. Commit or rollback has to be happen in this thread as well.

    In your example you start new threads to execute updates, so they are not enlisted. Essentially, each operation is executed in a separate implicit transaction, which results in the behavior you observe.