Thanks a lot Dan,
It's exactly what I was looking for. It was so easy. Now I can see.
Thanks Again.
On Wed, Sep 30, 2009 at 3:50 PM, Dan Ostrowski wrote:
>
> Sounds like you need an atomic operation.
>
> Instead of doing a SELECT, do an UPDATE and then check the affected
> rows, such as:
>
> U
Sounds like you need an atomic operation.
Instead of doing a SELECT, do an UPDATE and then check the affected
rows, such as:
UPDATE table SET flag = 1 WHERE flag = 0;
Then check if the operation succeeded.
Cheers,
Dan
On Sep 30, 11:38 am, gustavo Cardoso wrote:
> Acctually,
>
> I need to do
Acctually,
I need to do a SELECT in a table. In this table has a flag field. if the
flag field has 0 so I can update de flag field to 1.
In other words I need to do a SELECT by verifing if the flag field is 0. And
after, I can update to 1 the flag field.
But the problem is: More than one access o
Create locks and store them at cache as keys.
Or implement counter as cache.incr('users_online')
On Wed, Sep 30, 2009 at 3:52 AM, Nan wrote:
>
> Any particular reason you can't just use User.objects.count() ?
>
> On Sep 29, 7:16 pm, gustavo Cardoso wrote:
> > Hello Folks,
> >
> > I need to impl
Any particular reason you can't just use User.objects.count() ?
On Sep 29, 7:16 pm, gustavo Cardoso wrote:
> Hello Folks,
>
> I need to implement a Counter.
> One variable to store the number of users in my site.
> This variable can't be access in the same time for more than one user.
> How I do
5 matches
Mail list logo