1 person found this helpful
(2) seems to be a pretty standard approach for these sorts of things, unless you can spend the time to do (3). For (3), you can use a Comet-like approach (something like Granite DS Gravity--not sure if existing solutions exist for PHP, but it's not rocket surgery to roll your own) or polling / long-polling (which will be simpler if not quite as accurate).
Thanks for the pointer. I'm a bit worried about the users having to decide whether to dump the changes they've just made to a record or to overwrite someone else's changes.
I've since taken another look at Weborb for PHP - something I investigated briefly a while back but abandoned because of lack of good documentation unless you take a support plan and Adobe's team-up with Zend
Using the Weborb Data Management for Flex (WDMF) I was able to migrate my basic CRUD services across in literally 5 mins and as Weborb supports Flex Messaging and runs on PHP, I'm nearly there.
Now if I can just find some info on implementing PHP session management in Weborb to migrate the authentication class...
Anyone had any experience with this?
For anyone else that comes looking for an answer..
- I moved over to using Weborb for PHP v3.6 for remoting
- converted my remoting classes with little effort
- couldn't get Weborb's security adaptor authenticating against mysql so implemented a PHP session based auth controller
- I then used Weborb's messaging service to send updates out to connected clients when records are created, updated or deleted
I found the lack of documentation for Weborb for PHP very frustrating. I used some of the Weborb.NET docs for reference but as you'd expect there are differences.
The last lingering annoyances are:
- There seems to be a 'size limit' for message body contents either on the AS3 side or Weborb - I tried sending typed objects in the AsyncMessage body to do single record updates in the app but when the message was received I got an error saying "Adobe AIR Error - end of file" or something like that and the message queue stopped working until I cleared the server message cache. So instead I send a string of which dataset needs updating - less efficient but serves the purpose for the moment.
- I can't for the life of me find any info on clearing the PollCache folder which is where messages are stored on the server even after delivered! I read about some people running server side scripts to clear the cache every now and then... but can't believe you can't delete them from via a command from the client or set a TTL. I found some reference to setting the <message-time-to-live> property in the messaging-config.xml but it seems to have not effect.
Anyway, that's my take on "How to maintain data consistency for multi-user Flex app?".