You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ignite.apache.org by Sumanta Ghosh <su...@yahoo.com> on 2017/11/25 06:19:02 UTC

Ignite SpringTransactionManager not rolling back cache changes

Hi, 
I am using Ignite's SpringTransactionManager in my spring boot application
along with spring-data-jpa. I am using ignite's SpringTransactionManager
class for transaction along with spring's JpaTransactionManager using spring
data's ChainedTransactionManager class. Following is my configuration:-

        @Bean
	@Primary
	public PlatformTransactionManager
transactionManager(@Qualifier("igniteSpringTxnManager")
SpringTransactionManager igniteSpringTxnManager, 
			EntityManagerFactory factory) throws Exception {
		return new ChainedTransactionManager(igniteSpringTxnManager, new
JpaTransactionManager(factory));
		//return igniteSpringTxnManager;
	}

This works fine for successsful DB transactions; however, whenever there is
an error (e.g. DB error for column length mismatch), I am seeing the cache
entry is not rolled back even if ignite's SpringTransactionManager displays
the following in the log 

2017-11-25 11:46:57.780 DEBUG 3556 --- [nio-8443-exec-4]
o.a.i.t.spring.SpringTransactionManager  : Initiating transaction rollback

SO, it seems even if log says rolling back, the rolling back is not
happening actually.
Can you please help me identifying the issue?




--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite SpringTransactionManager not rolling back cache changes

Posted by Sumanta Ghosh <su...@yahoo.com>.
hi Nikolai,
Thanks a lot. It worked after TRANSACTIONAL  setting.

Thanks once again
Sumanta



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/

Re: Ignite SpringTransactionManager not rolling back cache changes

Posted by Nikolai Tikhonov <nt...@apache.org>.
Hi,

It seems misconfiguration. Could you share your cache configuration and
double check that you set CacheConfiguration#setAtomicityMode to
TRANSACTIONAL instead of ATOMIC which used by default?


On Sat, Nov 25, 2017 at 9:19 AM, Sumanta Ghosh <su...@yahoo.com>
wrote:

> Hi,
> I am using Ignite's SpringTransactionManager in my spring boot application
> along with spring-data-jpa. I am using ignite's SpringTransactionManager
> class for transaction along with spring's JpaTransactionManager using
> spring
> data's ChainedTransactionManager class. Following is my configuration:-
>
>         @Bean
>         @Primary
>         public PlatformTransactionManager
> transactionManager(@Qualifier("igniteSpringTxnManager")
> SpringTransactionManager igniteSpringTxnManager,
>                         EntityManagerFactory factory) throws Exception {
>                 return new ChainedTransactionManager(igniteSpringTxnManager,
> new
> JpaTransactionManager(factory));
>                 //return igniteSpringTxnManager;
>         }
>
> This works fine for successsful DB transactions; however, whenever there is
> an error (e.g. DB error for column length mismatch), I am seeing the cache
> entry is not rolled back even if ignite's SpringTransactionManager displays
> the following in the log
>
> 2017-11-25 11:46:57.780 DEBUG 3556 --- [nio-8443-exec-4]
> o.a.i.t.spring.SpringTransactionManager  : Initiating transaction rollback
>
> SO, it seems even if log says rolling back, the rolling back is not
> happening actually.
> Can you please help me identifying the issue?
>
>
>
>
> --
> Sent from: http://apache-ignite-users.70518.x6.nabble.com/
>