"Sylvain Hellegouarch" <[EMAIL PROTECTED]> writes:

> Besides, it is also possible that between the time you request an ID and
> the time you actually fetch the row for that ID, this one may have been
> deleted and you will hit an error.

This depends on the isolation level and how he started the process...  I
believe that he can work with a snapshot where all retrieved IDs still have
their data available if he's inside a transaction and had the correct
isolation level on his database / connection to the database.

> I really fail to understand the benefit of that technique but I'm not a
> database/ORM expert anyway.

Probably they're working more on the client side -- doing the FK consistency,
JOINs, filtering, etc. -- than on server side.  For the server side I'd go
with a function, a view or even something that would retrieve what I need
directly.

To make one operation with SQLObject, make it a list():

    data = model.MyTable.select(orderBy = model.MyTable.q.description)
    data = list(data) # <--  this makes one select only

(Of course, you can write it in one line, I just wanted to point out what
 makes the "single" access to the database.  ---  I believe there are two, one
 to retrieve the columns and one to retrieve the data.)


There were techniques and products shown here (such as memcached) to optimize
things and implement a global cache...  Those should also help with the
database hitting problem, but I have never tried it to see how it will handle
SQL Object SelectResults... 



-- 
Jorge Godoy      <[EMAIL PROTECTED]>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to