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