Jump to content

near simultanious saving of field data - best approach?


formulate
 Share

Recommended Posts

Hi, I have a ModX site I'm porting over and I have the following situation (simplified for explanation purposes):

1 page. 10 text fields. 10 individual users that can edit the page. Each user is assigned to and can only edit one field. Example: User 1 = Field 1, User 2 = Field 2, etc. What happens when all users edit the page at the same time (ie: open the page within a few seconds of each other) and then save a minute or two later at random times. Is PW smart enough to compare what's changed and only update the one field or will it overwrite all page fields with data from that particular user's session? Also, what happens if 10 users try saving all at the same time? I presume PW just queues up the DB saves and sequentially executes, hopefully only writing data that has changed via a compare of some sort. I don't want a situation where User 2's save overwrites User 1's field data, etc.

The way I got around this issue with ModX was to assign users a unique page each, that way they are all writing to their own unique page and therefore the above issue is not present. I then fetch and glue all those page's info together for presentation on the main page. Make sense? Is this the best approach to use in PW? Is there a better way I could be doing this?

Link to comment
Share on other sites

Not really an answer, but perhaps this can help.

Unfortunately doesn't help. I actually NEED all users to edit at the same time. I don't want to lock them out at all. It's critical functionality for a web app I'm developing. I also forgot to mention that users will be editing from a front-end form, not the admin.

Link to comment
Share on other sites

No PW isn't smart enough. But you. If that a on front end you just save the field and done.

No PW isn't smart enough. But you. If that s on front end you just save the field and done. It's in your hand to page->save(field)

Awesome! Thanks Soma. In ModX I couldn't save an individual field, I had to save the entire page. Didn't realize with PW I could just save a single field.

I guess my next question is: Is this the best approach? Should I be storing all the field data on one page or would it make more sense to have each field as it's own page? What if I need to add more fields or more users?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...