You are here: Blog » Tech tips » Exploring Apache Ignite

Exploring Apache Ignite
An Apache cache with JTA/XA support

| | | , , ,
Looking to use Apache Ignite and its JTA/XA support with Atomikos?

We never heard of it before, but were asked about Apache Ignite and its compatibility with Atomikos (and JTA/XA in general). We started looking at it and thought we would share our thoughts and findings in this post. I would like to stress that this is not a real "review" post since we don't know the project enough (yet). Rather, we are exploring what can be found on the project's website. If you have any additional comments or feedback, feel free to share at the bottom of this post. We'd love to get the complete picture and maybe you can help smile

First Contact: GitHub

Our first contact with Ignite was an example project on GitHub. It suggests a configuration of Ignite with TransactionsEssentials. We'll come back to that further on in this post.

Apache Ignite at Apache

Google sends us to this project homepage. The page looks good, quite frankly.

ACID Transactions and JTA/XA

The homepage features ACID Transactions - clicking on this brings us to this documentation page. At the bottom of that page we find a section on JTA/XA integration. It suggests that the following use case is supported:
IgniteCache<String, Integer> cache = cache();
UserTransactionManager utm = new UserTransactionManager();
cache.put("key", "value");

In other words, this is similar to our Hazelcast integration. So far, so good!

Instead of calling begin() and commit() on the UserTransactionManager, you can also use Spring's @Transactional annotation. That should also work (because Spring really delegates to the UserTransactionManager).

More Transaction Features

The project also has this feature page - all about its transaction support.

Of all the things there, what catches my eye is the section on two-phase-commit. Going to that page, it says somewhere:

Ignite utilizes a Two-Phase-Commit (2PC) protocol for its transactions and optimizes to one-phase-commit whenever possible. Whenever data is updated within a transaction, Ignite will keep a transactional state in a local transaction map until commit() is called, at which point, if needed, the data is transferred to participating remote nodes.

So it seems like whatever you put in the cache is kept locally until the commit phase. That makes me wonder: what happens if two concurrent transaction put a value for the same key? Probably one of them will fail during the prepare phase of the two-phase commit (we did not test it).

Trying the Example on GitHub

What happens if we run the example on GitHub - mentioned in the beginning of this post? We tried, and here is the result:

[INFO] 3 errors 
[INFO] -------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1:07.892s
[INFO] Finished at: Wed Jul 31 09:34:16 CEST 2019
[INFO] Final Memory: 25M/135M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.5.1:compile (default-compile) on project ignite-examples: Compilation failure: Compilation failure:
[ERROR] /Users/guy/Downloads/ignite-examples-master/src/main/java/com/wangguofeng1923/ignite/examples/[15,46] package com.wangguofeng1923.examples.bytebuddy does not exist
[ERROR] /Users/guy/Downloads/ignite-examples-master/src/main/java/com/wangguofeng1923/ignite/examples/[16,46] package com.wangguofeng1923.examples.bytebuddy does not exist
[ERROR] /Users/guy/Downloads/ignite-examples-master/src/main/java/com/wangguofeng1923/ignite/examples/[17,46] package com.wangguofeng1923.examples.bytebuddy does not exist
[ERROR] -> [Help 1]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1]

In other words, it seems some code is missing?


Without a full review it is hard to come to a real conclusion, but this exploration of Ignite seems promising: it claims to support JTA/XA out-of-the-box. However, further testing is needed to come to a definitive conclusion - at least concerning full compatibility with Atomikos.

Contact Us

Atomikos Corporate Headquarters
Hoveniersstraat, 39/1, 2800
Mechelen, Belgium

T +3215613055

Subscribe to our newsletter

Never miss an update

Copyright 2021 Atomikos BVBA | Our Privacy Policy
By using this site you agree to our cookies. More info. That's Fine