Hello Django Users,

I am writing an application that needs to do some 'advanced' SQL to update  
some tables. I am curious about the best way to lock tables and make the  
transaction safe. The solution I wrote for a Quick and dirty is:

DATABASE_ENGINE = str(settings.__getattr__("DATABASE_ENGINE"))

if DATABASE_ENGINE == "postgresql":
_lock = "lock table nav_object in share row exclusive mode;"
_unlock = ""
elif DATABASE_ENGINE == "mysql":
_lock = "lock table nav_object WRITE;"
_unlock = "unlock tables;"

And I append the appropriate strings, but this seems hackish and since I'm  
new to both python and Django I am looking for advice. Is there  
documentation for using django to lock tables etc... so I don't need to do  
this?

Thank you,
Mark

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to