Skip to content

Instantly share code, notes, and snippets.

@oucem
oucem / SpringTransactionRollbackSpec.groovy
Created June 14, 2017 11:06 — forked from yarosla/SpringTransactionRollbackSpec.groovy
Could not commit JPA transaction: Transaction marked as rollbackOnly (exploring various scenarios for this exception) See http://stackoverflow.com/a/42899742/697313
package ys
import groovy.util.logging.Slf4j
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.context.annotation.Bean
import org.springframework.context.annotation.Configuration
import org.springframework.context.annotation.PropertySource
import org.springframework.test.context.ContextConfiguration
import org.springframework.transaction.UnexpectedRollbackException
import org.springframework.transaction.annotation.Propagation