iain duncan schrieb: > >>> Tips or warnings? >> Keep caching off otherwise you might miss changes. > > How do I keep caching off in gears? > >> Ensure that you're always >> coding it safe and using transactions. > > Hmm, shouldn't the rdbm be taking caring of locking on it's own? I mean, > how is there any difference to the rdbm between multiple threads of one > app hitting the same table and threads of different apps doing the same > thing?
The DB does make certain guarantees - but these only affect the atomicity of a single sql statement. But if you need to make several statements to update something - e.g. an invoice with its respective itmes to bill for - you can do that with an explicit database lock, which is spelled "select ... for update" This will lock the rows in question. The bad thing: the very moment your app crashes with the lock still around, it will create a deadlock for all other processes waiting to get access. So you need to be very, very careful. Diez --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

