photo / frontend

The official @github repository of the Trovebox frontend software. A photo sharing and photo management web interface for data stored "in the cloud" (i.e. Amazon S3, Rackspace CloudFiles, Google Storage).
https://trovebox.com
Apache License 2.0
1.37k stars 244 forks source link

Lock rows in user table when performing updates #1230

Open patricksan opened 11 years ago

patricksan commented 11 years ago

I'm getting this many times:

500 - Query error: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry 'psantana+988-test@moogu.com-1' for key 'owner' - INSERT INTO `photo` (appId,host,views,status,permission,license,hash,size,filenameOriginal,width,height,dateTaken,dateTakenDay,dateTakenMonth,dateTakenYear,dateUploaded,dateUploadedDay,dateUploadedMonth,dateUploadedYear,pathOriginal,pathBase,title,tags,albums,description,latitude,longitude,owner,actor,id,exif,dateSortByDay) VALUES (:appId,:host,:views,:status,:permission,:license,:hash,:size,:filenameOriginal,:width,:height,:dateTaken,:dateTakenDay,:dateTakenMonth,:dateTakenYear,:dateUploaded,:dateUploadedDay,:dateUploadedMonth,:dateUploadedYear,:pathOriginal,:pathBase,:title,:tags,:albums,:description,:latitude,:longitude,:owner,:actor,:id,:exif,:dateSortByDay)
jmathai commented 11 years ago

Updated the title.

Problem appears to be that the user table isn't being locked. We either need to do a lock or put this in a transaction of some sort.