¡@

Home 

python Programming Glossary: transaction.commit

Race conditions in django

http://stackoverflow.com/questions/1030270/race-conditions-in-django

of transaction. e.g. from django.db import transaction @transaction.commit_manually def add_points request user User.objects.select_for_update..

when to commit data in ZODB

http://stackoverflow.com/questions/11254384/when-to-commit-data-in-zodb

if this is too naive my question is when should one call transaction.commit to commit the data If I call it at the end of the inner loop.. btree_container.setdefault Gnodes .append Hnodes score 1 transaction.commit What if I call it outside both the loops Something like ........ btree_container.setdefault Gnodes .append Hnodes score 1 transaction.commit Will all the data be held in the memory till I call transaction.commit..

What is an efficent way of inserting thousands of records into an SQLite table using Django?

http://stackoverflow.com/questions/1136106/what-is-an-efficent-way-of-inserting-thousands-of-records-into-an-sqlite-table-u

improve this question You want to check out django.db.transaction.commit_manually . http docs.djangoproject.com en dev topics db transactions.. would be something like from django.db import transaction @transaction.commit_manually def viewfunc request ... for item in items entry Entry.. item in items entry Entry a1 item.a1 a2 item.a2 entry.save transaction.commit Which will only commit once instead at each save . In django..

Why doesn't this loop display an updated object count every five seconds?

http://stackoverflow.com/questions/2221247/why-doesnt-this-loop-display-an-updated-object-count-every-five-seconds

@transaction.autocommit def my_count while True transaction.commit print Number of Things d Thing.objects.count time.sleep 5 note..

How do I force Django to ignore any caches and reload data?

http://stackoverflow.com/questions/3346124/how-do-i-force-django-to-ignore-any-caches-and-reload-data

the solution from django.db import transaction @transaction.commit_manually ... def flush_transaction ... transaction.commit ..... @transaction.commit_manually ... def flush_transaction ... transaction.commit ... MyModel.objects.get id 1 .my_field u'old' flush_transaction.. block with docstring from django.db import transaction @transaction.commit_manually def flush_transaction Flush the current transaction..

Aggregating save()s in Django?

http://stackoverflow.com/questions/3395236/aggregating-saves-in-django

to commit them in blocks using the commit_manually and transaction.commit but I've rarely needed that. Hope that helps Will share improve..

Optimizing performance of Postgresql database writes in Django?

http://stackoverflow.com/questions/9423539/optimizing-performance-of-postgresql-database-writes-in-django

questions and the solutions proposed suggest using transaction.commit_manually or transaction.commit_on_success decorators to commit.. proposed suggest using transaction.commit_manually or transaction.commit_on_success decorators to commit in batches instead of on every.. the bit of code that seems to take ages to complete @transaction.commit_manually def add_translations translation_data lp_translation..