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.

AnnouncementAnnouncement Module

Collapse

No announcement yet.

Differences in Transactionmanagement Hibernate and JPA TransactionmanagerPage Title Module

i got a simple test-application for finding out some differences in transaction-behavior between using native hibernate and the hibernate implementation of JPA because i want to switch an application from pure hibernate
to JPA 2.0

i made this tes app because, when using hibernate (sessionfactory/hibernatetransactionmanager) it is not necessary to put a @Transactional annotation to a method to persist an entity. in jpa (from hibernate) nothing will be persisted without the @Transactional
there is one config using hibernate SessionFactory and spring's HibernateTransactionManager both using the same datasource bean

the other config uses a LocalContainerEntityManagerFactoryBean and JPATransactionManager.

i also use the hibernate/jpa templates provided by spring for data access. these are used by a repository class and the repository class is accessed by a facade.

in the facade, i put a @Transactional annotation on the required methods. therefore i discovered confusing behavior.