<context:annotation-config/>
<context:component-scan...
this is used for class that i need to annotated with @Repository @Service @Component…
<context:spring-configured />
<context:component-scan...
use if i need to use @Configurable
<tx:annotation-driven transaction-manager="transactionManager" />
<context:component-scan...
use if i need @Transactional , beside this what other metadata do I need to add in xml in order to use transaction management?
<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor" />
what is the need to add this in xml ? for what purpose?
In order to use transaction management you also need to declare a transactionManager to use. That declaration depends on the approach you use to access the data. For example, for plain JDBC you write:
This declaration is used to handle @PersistenceContext and @PersistenceUnit annotations for JPA data access configuration. Hovewer, support for this annotations also included in
<context:annotation-config />, so you don’t need to declare it explicitly if you use<context:annotation-config />.