spring db

Edit

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

jndi lookup

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

Dynamic DataSource Routing

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

SQLExceptionTranslator

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

TX 선언

<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

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>

스프링 트랜잭션 관련 링크

Spring에서 트랜잭션 관리

스프링 트랜잭션 주의할 것

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

JOTM

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

JOTM을 이용한 트랜잭션 처리

Sharding

DB적인 DB샤딩때 쓰는 DataSource routing ( http://dev.anyframejava.org/docs/anyframe/plugin/optional/routingdatasource/1.0.0/reference/htmlsingle/routingdatasource.html 참고 )

AbstractRoutingDataSource

Best effort