@Override
        public Object invoke(Object proxy, Method method, Object[] args)
                throws Throwable {

            if (method.equals(Connection.class.getMethod("commit"))) {
                throw new SQLException();
            } else if (method.equals(Connection.class.getMethod("rollback"))) {
                throw new SQLException();
            } else if (method.equals(Connection.class.getMethod("close"))) {
                throw new SQLException();
            }

            if (method.equals(Object.class.getMethod("toString"))) {
                return "Transactional(" + con + ")";
            } else if (method.equals(Object.class.getMethod("hashCode"))) {
                return con.hashCode();
            } else if (method.equals(Object.class.getMethod("equals",
                    Object.class))) {
                Object other = args[0];
                if (other != null && Proxy.isProxyClass(other.getClass())) {
                    InvocationHandler handler = Proxy
                            .getInvocationHandler(other);
                    if (ConnectionHandler.class.isAssignableFrom(handler
                            .getClass())) {
                        return con
                                .equals(ConnectionHandler.class.cast(handler).con);
                    }
                }
                return false;
            }

            return method.invoke(con, args);
        }