mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-15 12:15:50 +00:00
Transactions should be on the root application context (or Hibernate will not be able to persist entities)
This commit is contained in:
parent
9ee5e6f096
commit
b3b536194a
2 changed files with 4 additions and 2 deletions
|
@ -22,6 +22,8 @@
|
|||
<!-- import the dataSource definition -->
|
||||
<import resource="datasource-config.xml"/>
|
||||
|
||||
<context:component-scan
|
||||
base-package="org.springframework.samples.petclinic.service"/>
|
||||
|
||||
<!-- Configurer that replaces ${...} placeholders with values from a properties file -->
|
||||
<!-- (in this case, JDBC-related settings for the JPA EntityManager definition below) -->
|
||||
|
@ -40,7 +42,7 @@
|
|||
<!--
|
||||
Instruct Spring to perform declarative transaction management
|
||||
automatically on annotated classes.
|
||||
|
||||
|
||||
for mode="aspectj"/ see SPR-6392
|
||||
-->
|
||||
<tx:annotation-driven/>
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
- POJOs labeled with the @Controller and @Service annotations are auto-detected.
|
||||
-->
|
||||
<context:component-scan
|
||||
base-package="org.springframework.samples.petclinic.web, org.springframework.samples.petclinic.service"/>
|
||||
base-package="org.springframework.samples.petclinic.web"/>
|
||||
|
||||
<mvc:annotation-driven conversion-service="conversionService"/>
|
||||
|
||||
|
|
Loading…
Reference in a new issue