Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.skife.jdbi.v2.sqlobject;
 
 import  net.sf.cglib.proxy.MethodProxy;
 
    private final TransactionIsolationLevel isolation;
    {
        this. = tx.value();
    }
    @Override
    public Object invoke(HandleDing dingfinal Object targetfinal Object[] argsfinal MethodProxy mp)
    {
        ding.retain("pass-through-transaction");
        try {
            Handle h = ding.getHandle();
            if ( == .) {
                return h.inTransaction(new TransactionCallback<Object>()
                {
                    @Override
                    public Object inTransaction(Handle connTransactionStatus statusthrows Exception
                    {
                        try {
                            return mp.invokeSuper(targetargs);
                        }
                        catch (Throwable throwable) {
                            if (throwable instanceof Exception) {
                                throw (Exceptionthrowable;
                            }
                            else {
                                throw new RuntimeException(throwable);
                            }
                        }
                    }
                });
            }
            else {
                return h.inTransaction(new TransactionCallback<Object>()
                {
                    @Override
                    public Object inTransaction(Handle connTransactionStatus statusthrows Exception
                    {
                        try {
                            return mp.invokeSuper(targetargs);
                        }
                        catch (Throwable throwable) {
                            if (throwable instanceof Exception) {
                                throw (Exceptionthrowable;
                            }
                            else {
                                throw new RuntimeException(throwable);
                            }
                        }
                    }
                });
            }
        }
        finally {
            ding.release("pass-through-transaction");
        }
    }
New to GrepCode? Check out our FAQ X