$B:4F#$G$9!#(B<br>$B$?$S$?$S$9$_$^$;$s!#(B<br><br>$B$"$k%H%i%s%6%/%7%g%s(BA$B$NESCf$K(B requiresNewTx $B$GJL$N%H%i%s%6%/%7%g%s(BB$B$r<hF@$7$F(B<br>$B=hM}$r9T$J$&%m%8%C%/$,$"$k$H$-!"(BA$B$G(BsetRollbackOnly()$B$r$7$?8e$K!"(BB$B$,<B9T$5$l$k$H(B<br>$B0J2<$N(BException$B$,H/@8$7$^$9!#(B<br><br>==============================<br>Caused by: org.seasar.framework.exception.SIllegalStateException
: [ESSR0308]$B4{$K%m!<%k%P%C%/$H$7$F%^!<%/$5$l$F$$$^$9(B<br> at org.seasar.extension.jta.TransactionImpl.throwIllegalStateException(TransactionImpl.java:132)<br> at org.seasar.extension.jta.TransactionImpl.assertActive(TransactionImpl.java
:117)<br> at org.seasar.extension.jta.TransactionImpl.suspend(TransactionImpl.java:98)<br> at org.seasar.extension.jta.TransactionManagerImpl.suspend(TransactionManagerImpl.java:78)<br> at org.seasar.extension.tx.AbstractTxInterceptor.suspend
(AbstractTxInterceptor.java:194)<br> at org.seasar.extension.tx.RequiresNewInterceptor.invoke(RequiresNewInterceptor.java:46)<br>==============================<br><br>A$B$r(Bsuspend$B$7$h$&$H$9$k$H$-$KH/@8$9$k$h$&$G$9$,!"$3$l$O;EJ}$NL5$$$3$H$G$7$g$&$+!)(B<br><br>
$B$3$NNc$N%5%s%W%k%3!<%I$O0J2<$N$h$&$J7A$G$9!#(B<br><br>Class HogeService {<br><br> private FugaService fugaService;<br> private OtherTxService otherTxService;<br> private UserTransaction userTransaction;<br><div class="Ih2E3d"><br> public void execute() {
<br> doSomething();<br> try {<br> fugaService.execute();<br> } catch (Exception e) {<br></div> userTransaction.setRollbackOnl<div id="1fxb" class="ArwC7c ckChnd">y();<br> log.info(e);<br> }<br> doSomething2();
<br> otherTxService.execute(); <== S2Tx $B$G(B requresNewTx $B$r(BAspect$B$7$F$k%a%=%C%I(B<br> doSomething3();<br> }<br><br>}<br></div><br><br><div class="gmail_quote">On Dec 11, 2007 10:39 PM, Mitsutaka Sato <<a href="mailto:miztaka@gmail.com">
miztaka@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">$B>.NSMM!"(B<br>$B$465<x$"$j$,$H$&$4$6$$$^$7$?!#(B<br><br>$B=iJbE*$J(BTransaction$B$N;H$$J}$,$h$/$o$+$C$F$$$^$;$s$G$7$?!&!&!&(B
<br><br>$B$$$:$l$K$7$m!"(B<br>UserTransaciton$B$r(BDI$B$7$F;HMQ$9$l$P$h$$$h$&$G$9$M!#(B<br>$B$"$j$,$H$&$4$6$$$^$7$?!#(B<br><br><br><div class="gmail_quote"><div class="Ih2E3d">On Dec 8, 2007 9:00 PM, Koichi Kobayashi <<a href="mailto:koichik@improvement.jp" target="_blank">
koichik@improvement.jp</a>> wrote:<br></div><div><div></div><div class="Wj3C7c"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">$B>.NS(B (koichik) $B$G$9!%(B
<br><br>Date: Sat, 8 Dec 2007 12:55:20 +0900
<br><div>From: "Mitsutaka Sato" <<a href="mailto:miztaka@gmail.com" target="_blank">miztaka@gmail.com</a>><br>To: <a href="mailto:seasar-user@ml.seasar.org" target="_blank">seasar-user@ml.seasar.org
</a><br></div>Subject: [Seasar-user:12000] Re: Transaction$B6-3&$r@_Dj$7$?%3%s%]!<%M%s%H$,3,AXE*$K8F$S=P$5$l$?>l9g(B
<br><div><br>> // $B%H%i%s%6%/%7%g%s%3%_%C%H(B<br>> // $B"((B hogeService$BFb$G(BfooSerivce$B$NNc30$r%-%c%C%A$7$F(BsetRollbackOnly$B$7$F$k(B<br>> // $B$+$b$7$l$J$$$,!"(Bcommit()$B$G(BOK$B!)(B<br>> userTransaction.commit();<br></div>($BN,(B)<br>> $B$3$N$h$&$K=q$/$N$,@5$7$$(B*$B%9%?%$%k(B*$B$G$7$g$&$+!)(B
<br><br>$B$$$$$(!%(B<br>setRoolbackOnly() $B$7$?8e$K(B commit() $B$r(B<br>$B8F$S=P$9$HNc30$,?a$CHt$s$G$-$^$9!%(B<br><br>if (userTransacstion.isRollbackOnly) {<br> userTransaction.rollback();<br>} else {<br> userTransaction.commit();<br>}<br><br>$B$N$h$&$K$7$F$/$@$5$$!%(B<br>
<font color="#888888">
<br><br>--<br></font><div><div></div><div><component name="koichik"><br> <property name="fullName">"Koichi Kobayashi"</property><br> <property name="email">"
<a href="mailto:koichik@improvement.jp" target="_blank">koichik@improvement.jp</a>"</property><br> <property name="blog">"<a href="http://d.hatena.ne.jp/koichik" target="_blank">http://d.hatena.ne.jp/koichik
</a>"</property><br></component><br><br>_______________________________________________<br>Seasar-user mailing list<br><a href="mailto:Seasar-user@ml.seasar.org" target="_blank">Seasar-user@ml.seasar.org
</a><br><a href="https://ml.seasar.org/mailman/listinfo/seasar-user" target="_blank">
https://ml.seasar.org/mailman/listinfo/seasar-user</a><br></div></div></blockquote></div></div></div><br>
</blockquote></div><br>