geronimo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dain Sundstrom <d...@iq80.com>
Subject Re: Transactions?
Date Fri, 17 Jun 2005 16:44:50 GMT
On Jun 17, 2005, at 12:04 AM, Neal Sanche wrote:

>        UserTransaction tx = null;
>        InitialContext ctx = null;
>        try {
>            ctx = new InitialContext();
>            tx = (UserTransaction)ctx.lookup("UserTransaction");
>            tx.begin();
>            chain.doFilter(request, response);
>        } catch (Throwable e) {
>            throw new ServletException(e);
>        } finally {
>            try {
>                if (tx != null)
>                    tx.commit();
>                if (ctx != null)
>                    ctx.close();
>            } catch (Throwable ex) {
>                throw new ServletException(ex);
>            }
>        }

Is this a servlet filter?  I don't believe it is legal to propagate a  
tx out of a servlet filter (either down the chain or up the chain).

-dain

Mime
View raw message