Splendid issue with the login view, TransactionMiddleware, and DEBUG mode

2011-11-10 Thread Tobia Conforto
Phew! I just finished wrestling with a TransactionMiddleware ordering issue. Basically, if TransactionMiddleware is after SessionMiddleware (as suggested by the docs*) then a login operation, as done by the default login view, is only committed to the session when Django is running in debug mode

Re: TransactionMiddleware recommendation

2011-09-21 Thread Joe Mou
Thanks, really interesting read. On Wed, Sep 21, 2011 at 3:42 PM, Christophe Pettus wrote: > > On Sep 21, 2011, at 2:27 PM, Joseph Mou wrote: > > > Why is this preferable over the default auto-commit behavior? > > If you are certain that every single time you modify the database, you want > an i

Re: TransactionMiddleware recommendation

2011-09-21 Thread Christophe Pettus
On Sep 21, 2011, at 2:27 PM, Joseph Mou wrote: > Why is this preferable over the default auto-commit behavior? If you are certain that every single time you modify the database, you want an immediate commit (no object graphics, no possibility of dangling objects), the default behavior might wo

TransactionMiddleware recommendation

2011-09-21 Thread Joseph Mou
I saw that the docs recommend using TransactionMiddleware, even though it's not the default: https://docs.djangoproject.com/en/dev/topics/db/transactions/ Why is this preferable over the default auto-commit behavior? I wasn't able to find much more information when searching (mostl

TransactionMiddleware and 5xx responses

2010-03-03 Thread Dan Fairs
Hi there, Django's TransactionMiddleware only rolls back the transaction if an exception is raised in a view. If a view doesn't raise an exception, but returns (say) a 500 response directly, the transaction goes ahead and commits. I noticed this while using Piston, and there's

Re: TransactionMiddleware not working

2009-07-21 Thread Parag Shah
Thanks for the help. Transactions work just fine after changing MyISam to InnoDB. -- Thanks & Regards Parag Shah On Tue, Jul 21, 2009 at 7:42 PM, Randy Barlow wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Parag Shah declared: > > I am using MySql. I believe it does support tran

Re: TransactionMiddleware not working

2009-07-21 Thread Randy Barlow
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Parag Shah declared: > I am using MySql. I believe it does support transactions. MySQL only supports transactions if you are using INNODB tables. This is not the default. - -- Randy Barlow Software Developer The American Research Institute http://a

Re: TransactionMiddleware not working

2009-07-21 Thread Hank Gay
Not all of the storage engines in MySQL support transactions, e.g., MyISAM doesn't. On Tue, Jul 21, 2009 at 9:54 AM, Parag Shah wrote: > Hi Andrew, > > I am using MySql. I believe it does support transactions. Here is the > version line of my instance of MySql > > $mysql -V > mysql  Ver 14.12 Dis

Re: TransactionMiddleware not working

2009-07-21 Thread Parag Shah
Hi Andrew, I am using MySql. I believe it does support transactions. Here is the version line of my instance of MySql $mysql -V mysql Ver 14.12 Distrib 5.0.67, for debian-linux-gnu (x86_64) using readline 5.2 -- Thanks & Regards Parag Shah On Tue, Jul 21, 2009 at 7:16 PM, Andrew Fong wrote:

Re: TransactionMiddleware not working

2009-07-21 Thread Andrew Fong
Just double checking, but are you using a DB that supports transactions? On Jul 21, 8:16 am, Parag Shah wrote: > Hello, > > Hello, > > I am using TransactionMiddleware to get per request transactions working in > my Django project. However, it does not seem to be working. &g

TransactionMiddleware not working

2009-07-21 Thread Parag Shah
Hello, Hello, I am using TransactionMiddleware to get per request transactions working in my Django project. However, it does not seem to be working. I have a view in which I save an object and when I try to save a related object there is an Exception. However, the first object is still saved

Fwd: Re: TransactionMiddleware and SessionMiddleware

2008-12-10 Thread Tim Sawyer
On Wednesday 10 December 2008 16:46:36 Thomas Guettler wrote: > Hi, > > I follow: http://docs.djangoproject.com/en/dev/topics/db/transactions/ > {{{ > The order is quite important. The transaction middleware applies not > only to view functions, but also for all middleware modules that come > afte

TransactionMiddleware and SessionMiddleware

2008-12-10 Thread Thomas Guettler
ion.TransactionMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.middleware.doc.XViewMiddleware', ] But the result is not what is excepted if there is an exception:

Re: TransactionMiddleware

2008-04-03 Thread Constantin Christmann
ot;New db connection within a view" Regards, Constantin Karen Tracey schrieb: On Thu, Apr 3, 2008 at 4:58 AM, Constantin Christmann <[EMAIL PROTECTED]> wrote: Hope someone can help me out here: I am using TransactionMiddleware, are raw SQL queries inside a view part of the views

Re: Making TransactionMiddleware play nice with processException

2008-04-03 Thread Karen Tracey
On Thu, Apr 3, 2008 at 8:46 AM, shabda <[EMAIL PROTECTED]> wrote: > I have TransactionMiddleware in my settings.py, to tie transactions to > HttpRequests. I also have a custom mIddleware which has a > processException, it catches the Exceptions and returns user friendly >

Making TransactionMiddleware play nice with processException

2008-04-03 Thread shabda
I have TransactionMiddleware in my settings.py, to tie transactions to HttpRequests. I also have a custom mIddleware which has a processException, it catches the Exceptions and returns user friendly responses for the exceptions. This means that TransactionMiddleware thinks that exception was not

Re: TransactionMiddleware

2008-04-03 Thread Karen Tracey
On Thu, Apr 3, 2008 at 4:58 AM, Constantin Christmann < [EMAIL PROTECTED]> wrote: > Hope someone can help me out here: > I am using TransactionMiddleware, are raw SQL queries inside a view part > of the views transaction? > I was hoping someone else would answer your other ques

TransactionMiddleware

2008-04-03 Thread Constantin Christmann
Hope someone can help me out here: I am using TransactionMiddleware, are raw SQL queries inside a view part of the views transaction? Thanks, Constantin --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "D