txn attribute is no longer meaningful after Spring change

Kelven

On 9/4/13 9:46 AM, "Darren Shepherd" <darren.s.sheph...@gmail.com> wrote:

>I see @DB(txn=false) a lot in the code.  The javadoc says "By marking
>txn=false the method is not surrounded with transaction code" but I
>can't find any code that backs up this claim.  I only can find the below
>code in com.cloud.utils.db.TransactionContextBuilder that seems to point
>to the fact that only the existence of @DB indicates a transaction.
>
>     @Override
>     public boolean needToIntercept(Method method) {
>         DB db = method.getAnnotation(DB.class);
>         if (db != null) {
>             return true;
>         }
>
>         Class<?> clazz = method.getDeclaringClass();
>
>         do {
>             db = clazz.getAnnotation(DB.class);
>             if (db != null) {
>                 return true;
>             }
>             clazz = clazz.getSuperclass();
>         } while (clazz != Object.class && clazz != null);
>
>         return false;
>     }
>
>I grep'd through the code for ".txn()" and never once found a reference
>to it.  Its is safe to assume the txn attribute on @DB is bogus?
>
>Darren

Reply via email to