Meanwhile I found out that the transaction manager that was used while saving or updating an entity was a JPATransactionManager - although my configuration uses the HibernateTransactionManager. Another project (jar) in the web application also defines a transaction manager in its hibernate configuration, in fact an JPATransactionManager.
In the web.xml this project configuration was loaded first, before my project configuration, so the JPATransactionManager was used:
Code:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:another_project_with_jpa_tm_context.xml
classpath:my_project_with_hibernate_tm_context.xml
</param-value>
</context-param>
When I exchange the order of configuration in the web.xml the HibernateTransactionManager is used and the exception is gone.
Code:
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>
classpath:my_project_with_hibernate_tm_context.xml
classpath:another_project_with_jpa_tm_context.xml
</param-value>
</context-param>
Can't we use several transaction managers in a web application?