Re: Problem with django.db.transaction.commit_manually

2008-02-18 Thread Brot
I have found a solution. Could someone tell me, if this is OK or if this is a bad solution? > > finally: > > if result['status'] == 'OK': transaction.set_clean() > > otherfile.test() > > reserv.delete() > > transaction.commit() > > else: >

Re: Problem with django.db.transaction.commit_manually

2008-02-18 Thread Brot
Hello, The view works well if I delete the call 'otherfile.test()' There is also no error if I delete the dictionary declaration in 'otherfile.test()'. My example code is only an extraction from my code. In my real 'test-function' is a lot of code (I use urlib, urlib2 and htmllib there). But the

Re: Problem with django.db.transaction.commit_manually

2008-02-18 Thread Thomas Guettler
Hi, You get this because the transaction is 'dirty' (some statement was executed, but there was no commit/rollback afterwards). I guess this happens in render_to_response in your example. > K' > finally: > if result['status'] == 'OK': > otherfile.test() > rese

Re: Problem with django.db.transaction.commit_manually

2008-02-17 Thread Brot
Hello again, here is a code example. Hope someone could help me - from otherfile import test @transaction.commit_manually def view(request, secid): result = {'status': 'OK', 'msg': None} try: res

Problem with django.db.transaction.commit_manually

2008-02-17 Thread Brot
Hello, If I have a view and use the 'django.db.transaction.commit_manually' decorators. All worked well, but than I inserted a function call into the view. In this function I don't touch the database If I call the view I get following error message: Transaction managed block ended with pending C