You can use @Transactional without AspectJ. Your configuration file should contain the following:
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:util="http://www.springframework.org/schema/util" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd" > <tx:annotation-driven/>
tells spring to search for @transactional annotations when instantiating customized beans. When searching for such an annotation, spring returns a dynamic bean proxy to the application code. This dynamic proxy ensures that whenever annotated methods are called, spring can intercept it to provide the expected transactional behavior. But proxy-based AOPs require you to code interfaces, not specific classes.
source share