Almost confused the Transactional annotation

from : http://blog.sina.com.cn/s/blog_72ef7bea0101h3zr.html

Almost confused the Transactional annotation

  (2014-04-01 20:03:28)
Add the following Service and Transactional annotations to my Srping business layer today:
@Service
@Scope(BeanDefinition.SCOPE_SINGLETON)
@Transactional(propagation=Propagation.REQUIRED,
               timeout=600, 
               rollbackFor=Exception.class)
The result always does not recognize propagation, timeout and rollbackFor. Later, I found out that I introduced the wrong class definition. I should have used Spring's org.springframework.transaction.annotation.Transactional , but JavaEE was introduced for CDI (Contexts and Dependency Injection for the Java EE platform, context and dependency injection) bean's javax.transaction.Transactional , it's really easy to get confused if you don't pay attention. Almost confused the Transactional annotation

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325997036&siteId=291194637