Ok, that makes sense.
The thing is, we've written some python plugins for Softimage to read and write to the db that get loaded and stay in memory. When the plugins are loaded, the django models are imported. So during the lifetime of the host application, the python session is the same.
So I really need a way of closing the transaction or flushing the sql in django, without starting a new python session.
Any ideas warmly received.
Julian.
This should work better:
from django.db import transaction
transaction.enter_transaction_management()
transaction.managed(True)
# do some work
transaction.commit()
# do some more work
transaction.commit()
transaction.leave_transaction_management()
transaction.managed(False)
# exit
As documented here:
https://docs.djangoproject.com/en/1.3/topics/db/transactions/
Cheers
Tom