> I modified my code as you suggested.  It's still calling the sa_rwt :(
>
> Worthy to note that I still have the MultiorderGenericFunction being
> used as well.
>

:(

> I think this problem has to do with the evaluation of the
> run_with_transaction.when rule.  When I logged something in that
> condition, I only got output during load time when the methods were
> being exposed.  I never got logging when I actually accessed the
> method.  You mentioned that it was supposed to be evaluated at call
> time though.

I'm pretty sure that rules that cannot be determined at "compile" time are
evaluated at call time:

In [1]: from dispatch import generic, strategy

In [2]: @generic()
   ...: def foo(b):
   ...:     pass
   ...:

In [3]: def b_gt_2(b):
   ...:     print "checking b"
   ...:     return b>2
   ...:

In [4]: foo.when("b_gt_2(b)")(lambda b: b+2)
Out[4]: <function <lambda> at 0xb77c72cc>

In [5]: foo(1)
checking b
---------------------------------------------------------------------------
dispatch.interfaces.NoApplicableMethods
In [6]: foo(3)
checking b
Out[6]: 5

As you can see, "checking b" is printed in every call... What gets
evaluated at "compile" time are "static" rules because if the solution can
be determined at "compile" time then RD can optimize those rules in order
to minimize checks (please forgive my simplistic explanation, I'm no RD
guru... ;)

Hmmm, this makes me wonder... have you tried:

def _check_no_trans(func):
    return getattr(func_original(func), '_no_trans', False) and _use_sa()

@run_with_transaction("_check_no_trans(func)")
def sadsadfsdf(....):
    .....

Alberto






--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to