This forum is now a read-only archive. All commenting, posting, registration services have been turned off. Those needing community support and/or wanting to ask questions should refer to the Tag/Forum map, and to http://spring.io/questions for a curated list of stackoverflow tags that Pivotal engineers, and the community, monitor.

Spring 1.1.5 -> 1.2.6 : Tx marked as rollback-only

Aug 22nd, 2007, 12:38 PM

Hi,

I had JUnit Spring Mock code, using Spring 1.1.5, Hibernate 2.1.x. It was working fine.
I moved to Spring 1.2.6 (actually changed 2 jars : spring, and spring-mock, I'm not using the "full" jars, I include all dependencies one by one). Now I get : "Transaction has been rolled back because it has been marked as rollback-only".

service.somethingIExceptToSucceed(); // <-- this fails at commit because previous call marked the whole transaction as rollback.

All comes from the behaviour that commit/rollbacks are attempted by the AOP Transaction Manager around services that participated in an already existing transaction when marked as PROPAGRATION_REQUIRED. I wouldn't except a commit() to be called "during" the transaction.