19 Haziran 2018 Salı

SpringBoot spring.jta Ayaları

Giriş
Açıklaması şöyle
One way to implement 2PC in Spring Boot is to use the XA (eXtended Architecture) protocol, which allows multiple databases to participate in a single transaction. Spring Boot provides support for XA transactions through the Atomikos and Bitronix transaction managers, which can be used to coordinate transactions across multiple services.

Örnek
Şöyle yaparız.
spring.jta.enabled=true
spring.jta.atomikos.properties.log-base-dir=target/transaction-logs/
spring.jta.atomikos.properties.service=
  com.atomikos.icatch.standalone.UserTransactionServiceFactory
spring.jta.atomikos.properties.max-timeout=900000
spring.jta.atomikos.properties.default-jta-timeout=90000
spring.jta.atomikos.properties.threaded-two-phase-commit=true
spring.jta.atomikos.datasource.default-isolation-level=2
spring.transaction.default-timeout=900

Hiç yorum yok:

Yorum Gönder