Re: #18557: get_or_create() causes a race condition with MySQL

2012-09-04 Thread Anssi Kääriäinen
On 4 syys, 17:53, lucky wrote: > *E) Use locking with SELECT query* > According tohttp://dev.mysql.com/doc/refman/5.5/en/innodb-consistent-read.html > >  If you want to see the “freshest” state of the database, use either the > READ COMMITTED isolation level or a locking read: >  SELECT * FROM t

Re: Django Oracle backend vs. numbers

2012-09-04 Thread Ian Kelly
On Tue, Sep 4, 2012 at 3:28 PM, Anssi Kääriäinen wrote: > I did some digging, and the reason for the error is this line in the > patch: > self.cursor.outputtypehandler = self._outputtypehandler > > What is happening is that self has a reference to self.cursor, which > has reference to bound me

Re: Django Oracle backend vs. numbers

2012-09-04 Thread Anssi Kääriäinen
I did some digging, and the reason for the error is this line in the patch: self.cursor.outputtypehandler = self._outputtypehandler What is happening is that self has a reference to self.cursor, which has reference to bound method self._outputtypehandler, which has a reference to self. Thus, t

Re: Django Oracle backend vs. numbers

2012-09-04 Thread Shai Berger
On Tuesday 04 September 2012, Ian Kelly wrote: > On Mon, Sep 3, 2012 at 6:14 AM, Shai Berger wrote: > > On Wednesday 29 August 2012 22:17:22 Ian Kelly wrote: > >> https://github.com/ikelly/django/commit/086f502a1c2acb9db27531f7df78cb9d > >> f9a b83bd > > > > more subtle; either way, this is what

Re: Django Oracle backend vs. numbers

2012-09-04 Thread Ian Kelly
Resending to the list: On Sep 4, 2012 11:44 AM, "Ian Kelly" wrote: > > On Mon, Sep 3, 2012 at 6:14 AM, Shai Berger wrote: > > On Wednesday 29 August 2012 22:17:22 Ian Kelly wrote: > >> > >> https://github.com/ikelly/django/commit/086f502a1c2acb9db27531f7df78cb9df9a > >> b83bd > >> > > I've run a

Re: RawQuerySet as subquery when used with an __in filter

2012-09-04 Thread Anssi Kääriäinen
On 30 elo, 11:46, Alex Hill wrote: > Hi, and thanks for making Django. > > At the moment, when passing a RawQuerySet to an __in filter, the raw query > is evaluated and the result passed as a parameter to the filter's SQL. It > would be nice to have the option of using the raw SQL in a subquery >

Re: #18557: get_or_create() causes a race condition with MySQL

2012-09-04 Thread Cal Leeming [Simplicity Media Ltd]
Curious - I didn't know about that. At some point I will have to build a unit test for all these approaches, and see which comes out best - prob won't have time to sort this out for a few weeks though. Cal On Tue, Sep 4, 2012 at 3:53 PM, lucky wrote: > *E) Use locking with SELECT query* > Acco

Re: #18557: get_or_create() causes a race condition with MySQL

2012-09-04 Thread lucky
*E) Use locking with SELECT query* According to http://dev.mysql.com/doc/refman/5.5/en/innodb-consistent-read.html If you want to see the “freshest” state of the database, use either the READ COMMITTED isolation level or a locking read: SELECT * FROM t LOCK IN SHARE MODE; It locks the SELECT