Re: a thread problem or my bad codes?

2008-07-01 Thread pength
I am using transaction, but still have the problem. ;( You are right, my problem is from "concurrent requests", which I have searched in this group, but haven't found a very good solution... On 7月2日, 上午1时45分, phillc <[EMAIL PROTECTED]> wrote: > i think you need transactions? > > problem being

Re: a thread problem or my bad codes?

2008-07-01 Thread phillc
i think you need transactions? problem being that if all those processes happen at about the same time, they will all see enough money, then they will all process it. On Jul 1, 5:12 am, pength <[EMAIL PROTECTED]> wrote: > sorry for the bad indent of the "#models.py" part. I post it again, >

Re: a thread problem or my bad codes?

2008-07-01 Thread pength
sorry for the bad indent of the "#models.py" part. I post it again, hope this time that part will be shown OK. #models.py class Apple_For_Sale(models.Model): price = models.PositiveSmallIntegerField() has_been_sold = models.BooleanField(default=False) class People(models.Model):

a thread problem or my bad codes?

2008-07-01 Thread pength
I am using Django0.96/apache2/mod_python(running prefork MPM) / mysql, for my Django project, a typical Django environment, I think. And usually there're more than 10 apache2 processes running on my site, as the online users is about 100+. I found a problem that sometimes if one user clicks a