Hi, I can't use write through approach. I will be doing CRUD batch operations on oracle tables to avoid frequent calls to db. Now to keep ignite cache and oracle db consistent I have to use JTA transaction. Note: I have also enabled ignite persistance.
Can you please provide an example to configure jta with ignite? I have already gone through the ignite documentation,but it's not clear to me how to use it. I have configured the transaction manager in ignite configuration as shown by the Akash in his mail. But how to enlist oracle data source in transaction? As per the ignite doc, it uses user transaction. But how get the user transaction in first place? How to attach xa data source to this user transaction? Please advise, I stuck at this point. On Sat, Mar 24, 2018, 12:12 PM Denis Magda <dma...@gridgain.com> wrote: > Do you use Ignite as a distributed cache of your database? If it’s so, > then you can hook Ignite up with the database using CacheStore interface. > After that, Ignite will write-through changes automatically including > transactions. > > Denis > > On Friday, March 23, 2018, Prasad Bhalerao <prasadbhalerao1...@gmail.com> > wrote: > >> Can someone please answer this? >> I am also facing the similar problem. >> >> >> >> >> On Fri, Mar 23, 2018, 5:12 PM akash shinde <akashshi...@gmail.com> wrote: >> >>> Hello, >>> My requirement is to achieve ignite cache update operation and >>> database write operation in single transaction. >>> Right now I am trying to use JTA transaction management. I have created >>> below IgniteConfiguration using transactionConfiguration. But I am not >>> sure how to configure XAResource to this transaction manager. >>> I will be needing two XAResource here 1)Datasource(JDBC data source) >>> 2)Ignite cache. >>> >>> Please suggest how can I achieve this JTA transaction using two >>> XAResources. >>> >>> Please also suggest after all these configuration how to >>> get JtaTransactionManager instance to initiate the transaction. Currently >>> I am using Narayana JTA implementation. >>> >>> >>> private IgniteConfiguration getIgniteConfiguration(IgniteSpringBean ignite) >>> { >>> >>> IgniteConfiguration cfg = new IgniteConfiguration(); >>> cfg.setIgniteInstanceName("springDataNode"); >>> cfg.setPeerClassLoadingEnabled(false); >>> cfg.setRebalanceThreadPoolSize(4); >>> >>> * cfg.setTransactionConfiguration(transactionConfiguration());* >>> >>> >>> cfg.setCacheConfiguration(getIPContainerCacheConfiguration(),getIPContainerIPV4CacheConfiguration(),getUserPermissionCacheConfiguration(),getUserAccountCacheConfiguration()); >>> return cfg; >>> } >>> >>> >>> @Bean >>> public TransactionConfiguration transactionConfiguration(){ >>> TransactionConfiguration configuration = new TransactionConfiguration(); >>> Factory factory = new Factory() { >>> @Override >>> public Object create() { >>> return jtaTransactionManager(); >>> } >>> }; >>> configuration.setTxManagerFactory(factory); >>> *configuration.setUseJtaSynchronization(true);* >>> return configuration; >>> } >>> >>> @Bean >>> public PlatformTransactionManager jtaTransactionManager() { >>> JtaTransactionManager tm = new JtaTransactionManager(); >>> tm.setTransactionManager(transactionManager()); >>> return tm; >>> } >>> >>> @Bean >>> public TransactionManager transactionManager() { >>> return new TransactionManagerImple(); >>> } >>> >>> >>> Thanks, >>> Akash >>> >>