Mercurial > p > roundup > code
comparison roundup/backends/back_mysql.py @ 2718:b97aa2a9a504 maint-0.7
merge from HEAD
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 07 Oct 2004 05:44:35 +0000 |
| parents | eaf74cf96cfa |
| children | 8140fb128088 |
comparison
equal
deleted
inserted
replaced
| 2715:6ca9017b6f07 | 2718:b97aa2a9a504 |
|---|---|
| 464 # old-skool id generation | 464 # old-skool id generation |
| 465 def newid(self, classname): | 465 def newid(self, classname): |
| 466 ''' Generate a new id for the given class | 466 ''' Generate a new id for the given class |
| 467 ''' | 467 ''' |
| 468 # get the next ID | 468 # get the next ID |
| 469 sql = 'select num from ids where name=%s'%self.arg | 469 sql = 'select num from ids where name=%s FOR UPDATE'%self.arg |
| 470 if __debug__: | 470 if __debug__: |
| 471 print >>hyperdb.DEBUG, 'newid', (self, sql, classname) | 471 print >>hyperdb.DEBUG, 'newid', (self, sql, classname) |
| 472 self.cursor.execute(sql, (classname, )) | 472 self.cursor.execute(sql, (classname, )) |
| 473 newid = int(self.cursor.fetchone()[0]) | 473 newid = int(self.cursor.fetchone()[0]) |
| 474 | 474 |
