Hi again,

I was able to greatly reduce the accesses to the database by putting in session the "user_id" and the "username" (for future uses) after the login. However, there are still too many.

Seems to me that:
@tg.identity.require(tg.identity.Any(tg.identity.in_group('SYSADMIN'), tg.identity.has_permission("FARMACO_REPORT")))

makes multiple accesses to user and visit_identity tables.

Seems to me, that every time tg.identity is called there are 1 access to visit, 1 access to user and 2 accesses to visit_identity.

callable
number of accesses to user table
number of accesses to visit_identity table
tg.identity.require 1
2
tg.identity.Any 1
2
tg.identity.in_group 1
2
tg.identity.has_permission 1
2


Is there a way to reduce those accesses to db?

j



Jose Soares wrote:
I think I found the problem. I'm explicit using in my code:

identity.current.user.user_id  and
identity.current.user.username

to much and I think this is the main reason to have so many db accesses.
.
Thanks any way for your help.

j


On 04/27/2013 11:24 AM, Christoph Zwerschke wrote:
Am 27.04.2013 11:03, schrieb jo:
I don't know, because the accesses are the same even when there are no
rows (when the grid is empty).

Is it possible that some of your _javascript_ makes dozens of Ajax calls? Every Ajax call sparks a request to the identity management. Deactivate _javascript_ in your browser and see if this changes anything,
and have a look in your server and browser (e.g. Firebug) logs to understand what's going on.

-- Chris




--
You received this message because you are subscribed to the Google Groups "TurboGears" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/turbogears?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply via email to