3

TLDR:

1.Where does atomikos keep its trasnaction records so it can function and how is it best to "secure" them against losing/corrupting them. I use Docker/Docker-Compose and Spring Boot.

2.If the app dies unexpectdly, do all the transactions roll back because atomikos automagically started the appropiate SQL/JMS transactions with the sources?

Details

Hello.

I am starting to use atomikos in Spring Boot to enable XA transactions (in my case simply one datasource and an ActiveMQ/JMS broker.

I have been Googling and can't find a more "in depth" blog or site that explains in a bit more details how Atomikos works under the hood.

I do see the atomikos transaction logs in the form:

{"id":"127.0.1.1.tm159765570032300035","wasCommitted":true,"participants":[{"uri":"127.0.1.1.tm35","state":"COMMITTING","expires":1597655710327,"resourceName":"dataSource"},{"uri":"127.0.1.1.tm36","state":"COMMITTING","expires":1597655710327,"resourceName":"jmsConnectionFactory"}]}

I can only assume these are simply actual "logs" and not like the kafka.db file in say ActiveMQ when using file persistence.

Questions

  1. So does atomikos keep its state in memory?
  2. If say an unexpected shutdown occurred half way through an XA transaction, will all the JTA sources simply rollback?
  3. If the atomikos state is held in a file/database somewhere...are there some best practices when using docker-compose for example?

Example: A @Component picks out a database entity "REQUIRES_PROCESSING" for queuing on to a JMS queue and then switches the entity to "PROCESSING". The JMS message is queued but then the App unexpectedly dies before the database entity is set to "PROCESSING".

  1. Will in this case, atomikos has now no state (it died with the app) but it created a SQL and ActiveMQ trasnaction that will simply timeout and everything rolls back?
  2. The application reboots 5 seconds later...what happens here? Is this transaction picked up again somehow (i.e. atomikos has still got state somewhere?).
  3. Will the rebooted app just grab the rolledback entity and simply retry as expected?

Are there any pitfalls here?

Thank you for any claification.

Jcov
  • 2,122
  • 2
  • 21
  • 32

0 Answers0