Opened 17 years ago

Closed 17 years ago

#5310 closed (invalid)

sync database between two processes dynamically

Reported by: wanyancan@… Owned by: Adrian Holovaty
Component: Database layer (models, ORM) Version: dev
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

if two independent processes access the same model, how to make the second process see the result immediately taken by the first process's model.save()?
I've tested multiple threads in a single process, there's no such problem.
But when with two processes, I tested with the following steps:

  1. in process one:

    Pkg.objects.all().count()

4

  1. in process two:

    p = Pkg(name='hi'); p.save()

  2. in process two:

    Pkg.objects.all().count()

5

  1. in process one:

    Pkg.objects.all().count()

4

Here's the question: How to re-retrieve the objects from the database?

Change History (2)

in reply to:  description comment:1 by anonymous, 17 years ago

Replying to wanyancan@gmail.com:
Sorry for the wrong format, here's the steps I've tested

1. in process one: 
>>> Pkg.objects.all().count()
4
2. in process two:
>>> p = Pkg(name='hi'); p.save()
3. in process two:
>>> Pkg.objects.all().count()
5
4. in process one:
>>> Pkg.objects.all().count()
4
^^

comment:2 by Russell Keith-Magee, 17 years ago

Resolution: invalid
Status: newclosed

Please ask support questions on the django-users mailing list. The ticket tracker is for tracking bugs that need to be fixed.

Note: See TracTickets for help on using tickets.
Back to Top