[Seasar-user:14275] Re: DBのコミットについて
    Koichi Kobayashi
    [E-MAIL ADDRESS DELETED]
       
    2008年 5月 19日 (月) 18:30:25 JST
    
    
  
小林 (koichik) です.
Date:    Mon, 19 May 2008 18:24:32 +0900
From:    "小川昌幸" <[E-MAIL ADDRESS DELETED]>
To:      [E-MAIL ADDRESS DELETED]
Subject: [Seasar-user:14274] DBのコミットについて
> Pageクラスにてのdoメッソド内で、
> DBにインサート→他と通信→通信した結果でDBにアップデート
> したい処理をおこないたいのですが、
> 
> インサートした直後にコミットを掛けたいのですが、
> どのようにすればよろしいでしょうか?
insert と update は別のトランザクションにすると
いうことでしょうか?
それなら,insert を別のメソッドにして,その
トランザクション属性を requiresNew にしてください.
具体的には,insert するメソッド名が insertXxx() なら
customizer.dicon で次のようにしてください.
<component name="pageCustomizer"
    class="org.seasar.framework.container.customizer.CustomizerChain">
  <initMethod name="addCustomizer">
    <arg>requiredTxCustomizer</arg>
    <arg>"do.*, initialize, prerender"</arg>
  </initMethod>
  <!-- 以下を追加 -->
  <initMethod name="addCustomizer">
    <arg>requiresNewTxCustomizer</arg>
    <arg>"insert.*"</arg>
  </initMethod>
</component>
-- 
<component name="koichik">
    <property name="fullName">"Koichi Kobayashi"</property>
    <property name="email">"[E-MAIL ADDRESS DELETED]"</property>
    <property name="blog">"http://d.hatena.ne.jp/koichik"</property>
</component>
    
    
Seasar-user メーリングリストの案内