Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-09 Thread Chris Stoyles
The only log entries I want committed are the ones that tell me why a roll-back occurred. What you've said below sounds like a good enough solution, thanks for all your input. Cheers, Chris On Mon, Jun 8, 2009 at 11:38 PM, Karen Tracey wrote: > On Mon, Jun 8, 2009 at 5:39

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-08 Thread Karen Tracey
On Mon, Jun 8, 2009 at 5:39 AM, Chris Stoyles wrote: > Hi Thomas, > > The reason I want to be able to rollback (but still commit by log entries) > is because it is sometimes valid for this particular view to throw an > exception and fail. If this happens, I need to rollback

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-08 Thread Thomas Guettler
Chris Stoyles schrieb: > Hi Thomas, > > The reason I want to be able to rollback (but still commit by log entries) > is because it is sometimes valid for this particular view to throw an > exception and fail. If this happens, I need to rollback any model objects > that have been created and

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-08 Thread Chris Stoyles
Hi Thomas, The reason I want to be able to rollback (but still commit by log entries) is because it is sometimes valid for this particular view to throw an exception and fail. If this happens, I need to rollback any model objects that have been created and saved up to the point at which the view

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-08 Thread Thomas Guettler
Hi Chris, please explain in more depth what you want to do. If you do rollback, all changes won't be written to the database. Even all savepoints won't be stored. Why do you want to rollback? If you want your changes to get saved, you need to call transaction.commit() at the end. ChrisStoyles

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-07 Thread Chris Stoyles
Hi Karen, Yes it does look as though I am using them backwards. I am at a bit of a loss as to how to get around this problem, though it is Monday morning and my brain isn't fully into gear yet. Can anyone think of a way for me to bypass the transaction management? I believe that even if I execute

Re: Logging to Database while using @transaction.commit_manually decorator

2009-06-07 Thread Karen Tracey
On Sun, Jun 7, 2009 at 7:44 PM, ChrisStoyles wrote: > > Hi All, > > I just wanted to quickly reach out to the group for ideas as to why I > cannot get this to work: > > @transaction.commit_manually > def some_view(request): ># some view logic goes here > >sid =

Logging to Database while using @transaction.commit_manually decorator

2009-06-07 Thread ChrisStoyles
Hi All, I just wanted to quickly reach out to the group for ideas as to why I cannot get this to work: @transaction.commit_manually def some_view(request): # some view logic goes here sid = transaction.savepoint() le = models.LogEntry() le.message = 'A test log message'