I just checked out the examples for using dogpile caching mentioned here: 
http://docs.sqlalchemy.org/en/rel_0_9/orm/examples.html#module-examples.dogpile_caching.
 

According to the example in helloworld.py if a query is cached i.e. run the 
second time then the SQL is not generated. 
To illustrate attached is the code below:

 # Specifying a different query produces a different cache key, so# these 
results are independently cached.print("loading people two through twelve")
people_two_through_twelve = Session.query(Person).\
                            options(FromCache("default")).\
                            filter(Person.name.between("person 02", "person 
12")).\
                            all()


# ... but using the same params as are already cached, no SQLprint("loading 
people two through twelve...again!")
people_two_through_twelve = Session.query(Person).\
                            options(FromCache("default")).\
                            filter(Person.name.between("person 02", "person 
12")).\
                            all()


The second time we shouldn't see a SQL statement being fired. But I am. 
Is there any other way to confirm that the  cache is being used when querying 
second time around. 


-Sandeep



-- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to