Announcement Announcement Module
No announcement yet.
AOP and transaction Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • AOP and transaction

    I'm writing an article about Spring. I have two question about AOP:

    1. Is it correct to say - Spring AOP includes declarative transaction and interceptors Is declarative transaction AOP feature?
    Spring uses dynamic proxy for transaction management but dynamic proxy is no AOP.

    2. How can create object pooling? Is is Spring AOP capability?

  • #2
    Spring's declarative transaction management is built on top of AOP and its transaction management infrastructure (PlatformTransactionManager)

    Dynamic proxies != AOP.


    dynamic proxies is a technology with which you implement AOP. Note that you can also use CGLIB instead of JDK dynamic proxies, which adds the possibility to proxy a class without interfaces.

    Pooling is supported through Spring's PoolTargetSource (CommonsPoolTargetSource).

    A ProxyFactoryBean needs a target (reference to the target itself) or a TargetSource, of which PoolTargetSource is a subclass.

    Have a look at the PoolTargetSource's JavaDoc