12 Ekim 2021 Salı

TransactionConfiguration Sınıfı - Thick Client Transaction Ayarları İçindir

Giriş
Şu satırı dahil ederiz
import org.apache.ignite.configuration.TransactionConfiguration;
setUseJtaSynchronization metodu
Örnek
Şöyle yaparız
import org.apache.ignite.cache.jta.jndi.CacheJndiTmFactory;
import org.apache.ignite.transactions.TransactionConcurrency;
import org.apache.ignite.transactions.TransactionIsolation;

TransactionConfiguration transactionConfiguration  = new TransactionConfiguration()
  .setUseJtaSynchronization(Boolean.TRUE)
  .setTxManagerFactory(new CacheJndiTmFactory("java:jboss/TransactionManager"))
  .setDefaultTxConcurrency(TransactionConcurrency.OPTIMISTIC)
  .setDefaultTxIsolation(TransactionIsolation.READ_COMMITTED);

TcpCommunicationSpi tcpCommunicationSpi = ...;
DataStorageConfiguration dsStorageConfigureation = ...;
CacheConfiguration<String, OnboardingProcess> onboardingProcessCacheConfiguration = ...;

IgniteConfiguration cfg = new IgniteConfiguration()
  .setPeerClassLoadingEnabled(true)
  .setClientMode(Boolean.FALSE)
  .setIgniteHome("/Users/vip/workspace/local-ignite-home")
  .setDeploymentMode(DeploymentMode.CONTINUOUS)
  .setMetricsLogFrequency(60*10*1000)
  .setCommunicationSpi(tcpCommunicationSpi)
  .setDiscoverySpi(spi)
  .setDataStorageConfiguration(dsStorageConfigureation)
  .setAuthenticationEnabled(Boolean.TRUE)
  .setClusterStateOnStart(ClusterState.ACTIVE)
  .setClientMode(Boolean.FALSE)
  .setTransactionConfiguration(transactionConfiguration  )
  .setCacheConfiguration(onboardingProcessCacheConfiguration);

Hiç yorum yok:

Yorum Gönder

Ignite Transaction Kullanımı

Giriş Bir tablo 3 tane atomicity değerinden birisine sahip olabilir. 1. ATOMIC 2. TRANSACTIONAL 3. TRANSACTIONAL_SNAPSHOT ATOMIC Açıklaması ...