On Mon, Dec 19, 2011 at 1:36 PM, Michael Bayer <[email protected]>wrote:
> > On Dec 19, 2011, at 3:30 PM, Iain Duncan wrote: > > Ok, I know this is my fault but maybe someone can help me know what kind > of error I'm producing here, in saving a user, I'm getting the following > expection, but only occasionally ( like 10% of the time? ) > > 15:13:18,160 INFO [xornot.dram.views] EditAction.post() Exception from > self.update: Can't attach instance <Group at 0xb660d6c>; another instance > with key (<class 'xornot.auth.model.group.Group'>, (3L,)) is already > present in this session. > > > > "10% of the time" sounds like a race condition, but this doesn't appear to > be concurrent code, so then maybe something that occurs based on the > current shape of the data (like two #3's somewhere, type of thing).. > > Do you have something that's creating new Group objects if one does not > exist already ? You're basically looking to have only one Group(id=3) in > the Session at one time. > Is there any reason that getting the group with ID 3 would wind up putting a new one in the session? I thought had the session life cycle tightly under control. hmmm iain -- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.
