Spring's IoC and AOP and isolation levels

Spring's IoC and AOP

  • Spring AOP: proxy mechanism. Spring provides automatic proxy mechanism
  • Spring dependencies between the injection assembly IoC to implement the traffic control layer separation, i.e., customer specific service instance to call the component by calling the delegate service interfaces, to avoid maintaining coupling control layer and service layer brought or upgrades difficult.
  • By the Spring of DAO generated proxy object to add a transaction service to DAO, injected into the service component from the proxy instance IoC container DAO, the service component through delegate interface calls DAO object of DAO, so that the upper layer component does not directly depend on the DAO implementation class, persistence such changes or modifications do not affect the upper component.

Spring isolation level

  1. Serializable: the most stringent level, transaction serial execution, resource consumption maximum.
  2. REPEATABLE READ: to ensure that a transaction will not be read by another transaction has been modified but not committed (rollback) data. Avoid the situation "dirty read" and "non-repeatable read" but brings more performance loss.
  3. READ COMMITTED: default transaction level most popular databases, to ensure that a transaction will not read another concurrent transaction has been modified but not submitted data to avoid the "dirty read." This level is suitable for most systems.
  4. Read Uncommitted: ensure that the reading process is not illegal to read the data.

Guess you like

Origin www.cnblogs.com/zxfei/p/11443958.html