Spring DB

Spring에서 데이터베이스 연결하기

jndi lookup

IBM WebSphere Developer Technical Journal: IBM WebSphere Application Server를 위한 Spring 애플리케이션 개발하기 -- Part 2 (한글)

Add Some Spring to Your Oracle JDBC Access

Dynamic DataSource Routing

여러개의 DB에 선택적으로 커넥션하기

 

SQLExceptionTranslator

http://pietrowski.info/2008/09/how-to-extend-sqlerrorcodesfactory/

 

Transaction관련

TransactionDefinition

getPropagationBehavior, getIsolationLevel, getTimeout, isReadOnly

TransactionStatus

isNewTransaction, setRollebackOnly, isRollBackOnly

PlatformTransactionManager

HibernateTransactionManager

JtaTransactionManager

DataSourceTransactionManager

setDataSource

TransactionTemplate

TransactionCallBack.doInTransaction

TransactionProxyFactoryBean

setTransactionAttributes

디폴트 롤백규칙은 RunTimeException은 RollBack, CheckedException은 commit

NameMatchTransactionAttributesSource

setProperties

TransactionInterceptor

setTransactionManger, setTransactionAttributes

MethodMapTransactionAttributeSource

 

BeanNameAutoProxyCreator

<tx:advice id="txAdvice">

  <tx:attributes>

   <tx:method name="add*" propagation="REQUIRED"/>

  </tx:attributes>

</tx:advice>

 

<aop:config>

  <aop:advisor pointcut="execution(* *..*BO.*(...))" advice-ref="txAdvice"/>

</aop:config>

         <aop:advisor
         pointcut="execution(public * com.benelog.test..*.*BO.*(..))"
         advice-ref="txAdvice"/>

<tx:annotation-driven/>

<tx:annotation-driven transaction-manager="memberTransactionManager"/>

 

 

또는 <bean class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"/>

 

Spring, JPA, and JTA with Hibernate and JOTM

 

 

스프링 트랜잭션 관련 링크

Spring에서 트랜잭션 관리

스프링 트랜잭션 주의할 것

Propagation behavior

Isolation levels

SIA 6장 트랜잭션 관리 발표자료

Spring Transaction Management 선언적 트랜젝션 관리

ejb transaction attribute와 spring transactional propagation rules 비교

 

 

Annocation 기반

<tx:annotation-driven />
<tx:annotation-driven transaction-manager="txManager" />

 <property name="transactionAttributes">
   <props>
    <prop key="insert*">PROPAGATION_REQUIRED, -RuntimeException</prop>
    <prop key="update*">PROPAGATION_REQUIRED</prop>
    <prop key="*">PROPAGATION_REQUIRED</prop>
   </props>
  </property>

 

JOTM

spring 에서 JOTM 를 이용한 분산데이터베이스 transaction 처리

JOTM을 이용한 트랜잭션 처리

 

Best effort

http://www.javaworld.com/javaworld/jw-01-2009/jw-01-spring-transactions.html?page=6

https://jira.springsource.org/browse/SPR-3844