[Seasar-user:15354] Re: Intercepter でのトランザクション処理

Yasuo Higa [E-MAIL ADDRESS DELETED]
2008年 8月 11日 (月) 20:44:08 JST


$B$R$,$G$9!#(B
> 
> $B$$$E$N$G$9!#(B
> 
> 
> $B0J2<$N$h$&$J(Bintercepter$B$G(BJdbcManager$B$r;H$C$F%G!<%?%Y!<%9$N99?7=hM}$r$7$F$$$k$N$G$9$,!"(B
> intercepter$B$K%H%i%s%6%/%7%g%s@)8f$rE,MQ$9$kJ}K!$K$D$$$F65$($F$/$@$5$$!#(B
> 
> public Object invoke(final MethodInvocation invocation) throws Throwable {
>     Object ret = null;
>     Throwable cause = null;
>     try {
>         ret = invocation.proceed();
>     } catch (final Throwable t) {
>         cause = t;
>     } finally {
>         jdbcManager.insert(entity).execute();
>     }
>     if (cause == null) {
>         return ret;
>     }
>     throw cause;
> }
> 
> invocation$B$H$O%H%i%s%6%/%7%g%s$rJL$1$?$$$N$G$9$,(Bdicon$B$J$I$G$[E-MAIL ADDRESS DELETED]$G$[E-MAIL ADDRESS DELETED];EJ}$,A4$/;W$$Ib$+$P$:!"0J2<$NJ}K!$0$i$$$7$+;W$$$D$-$^$;$s$G$7$?!#(B
> $B-!(Binsert$B=hM}ItJ,$r(Bpublic$B%a%=%C%I$H$7$FCj=P$7!"([E-MAIL ADDRESS DELETED]("j2ee.requiredTx")$B$J%"%N%F!<%7%g%s$[E-MAIL ADDRESS DELETED]$9$k!#(B
> $B-"(Biintercepter$B$K(BUserTranzaction$B$r(BDI$B$7$F!"(Bbegin()$B!"(Bcommit()$B!"(Brollback()$B$r<+$iH/9T$9$k!#(B
> 
> $B-!$O(Bpublic$B%a%=%C%I$K$J$C$F$7$^$&$N$G$^$:$$$+$J$H;W$C$F$$$^$9!#(B
> 
1$B$G$$$$$s$8$c$J$$$G$9$+!#%H%i%s%6%/%7%g%s$rJ,$1$?$$$H$$$&$3$H$J$i(B
$B%"%9%Z%/%H$O(Bj2ee.requiresNew$B$,$$$$$H;W$$$^$9$,!#(B


Seasar-user メーリングリストの案内