Re: Logging transaction statements?

2015-02-10 Thread Carl Meyer
On 02/10/2015 04:03 PM, Erik Cederstrand wrote: >> But `self.connection.set_isolation_level()` is called in >> `_set_autocommit()`, and that should be sufficient. (The >> `_set_isolation_level()` method is dead code in 1.7 and has since >> been removed, but what really matters is that >> `self.c

Re: Logging transaction statements?

2015-02-10 Thread Erik Cederstrand
> Den 10/02/2015 kl. 23.45 skrev Carl Meyer : > > Yes, that's what I said :-) Thanks for the great explanations; I didn't see your previous answer before posting my latest reply, hence the duplicate explanations :-) > >> My code relies on isolation level "Serializable" for a cache.get() >> fol

Re: Logging transaction statements?

2015-02-10 Thread Carl Meyer
Hi Erik, On 02/10/2015 03:30 PM, Erik Cederstrand wrote: > Den 10/02/2015 kl. 21.27 skrev Erik Cederstrand > : >> >> Running this in parallel in two processes on the same machine >> returns this after a while: >> >> Process A: [...] >> >> Process B: [...] Traceback (most recent call last): File

Re: Logging transaction statements?

2015-02-10 Thread Erik Cederstrand
Den 10/02/2015 kl. 21.27 skrev Erik Cederstrand : > > Running this in parallel in two processes on the same machine returns this > after a while: > > Process A: > [...] > > Process B: > [...] > Traceback (most recent call last): > File "tmp.py", line 30, in > assert cache.add(key='foo',

Re: Logging transaction statements?

2015-02-10 Thread Carl Meyer
On 02/10/2015 02:46 PM, Carl Meyer wrote: > On 02/10/2015 01:27 PM, Erik Cederstrand wrote: >>> Den 10/02/2015 kl. 18.34 skrev Carl Meyer >> >: >>> >>> I assume you're using the 'db' cache backend? Otherwise, it wouldn't >>> make sense to expect transactions to affect cache

Re: Logging transaction statements?

2015-02-10 Thread Carl Meyer
On 02/10/2015 01:27 PM, Erik Cederstrand wrote: >> Den 10/02/2015 kl. 18.34 skrev Carl Meyer > >: >> >> I assume you're using the 'db' cache backend? Otherwise, it wouldn't >> make sense to expect transactions to affect cache calls at all. > > Yes, I'm using the db backend

Re: Logging transaction statements?

2015-02-10 Thread Erik Cederstrand
Hi Carl, > Den 10/02/2015 kl. 18.34 skrev Carl Meyer >: > > I assume you're using the 'db' cache backend? Otherwise, it wouldn't > make sense to expect transactions to affect cache calls at all. Yes, I'm using the db backend. > The difference between the snippets is th

Re: Logging transaction statements?

2015-02-10 Thread Carl Meyer
Hi Erik, On 02/10/2015 10:28 AM, Erik Cederstrand wrote: > Hmm, I'm beginning to think I don't understand Django transactions. I > have the following two snippets, boiled down from my original code. The > first one calls cache methods via helper functions, the other one calls > the cache methods d

Re: Logging transaction statements?

2015-02-10 Thread Erik Cederstrand
> Den 10/02/2015 kl. 17.15 skrev Erik Cederstrand : > > Hi list, > > I'm tracking down a bug in my app that shouldn't be happening with the > transaction statements I added in my code. In my logging settings, I can set > 'django.db.backends' to DEBUG to log the queries (I'm using the postresql

Logging transaction statements?

2015-02-10 Thread Erik Cederstrand
Hi list, I'm tracking down a bug in my app that shouldn't be happening with the transaction statements I added in my code. In my logging settings, I can set 'django.db.backends' to DEBUG to log the queries (I'm using the postresql backend). I see 'SAVEPOINT' statements logged, but I also need '