11

Is it possible to have PROPAGATION_NESTED in @Transactional() with JPA using postgres? I am getting:

org.springframework.transaction.NestedTransactionNotSupportedException:
JpaDialect does not support savepoints - check your JPA provider's capabilities

I tried:

@Bean
public PlatformTransactionManager transactionManager() {
    JpaTransactionManager transactionManager = new JpaTransactionManager();
    transactionManager.setEntityManagerFactory(entityManagerFactory()
                .getObject());
    transactionManager.setNestedTransactionAllowed(true);
    return transactionManager;
}

But with no success.

1
  • Which JPA implementation are you using? Commented Aug 21, 2017 at 8:30

2 Answers 2

17

I am assuming that you are using Hibernate. NESTED transactions is not possible with Hibernate.

enter image description here

In the following code excerpt, spring sets savePointManager. But there is no class implementing SavepointManager in Hibernate.

Sign up to request clarification or add additional context in comments.

1 Comment

Yes, I do use Hibernate. Ah, that's too bad. Suppose I will move from Hibernate to something else
-2

savepointAllowed is true, it means Transaction manager allow nested transactions. But JpaDialect does not support savepoints.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.