Page 1 of 1

using DOM XML and FLASH

Posted: Thu Nov 03, 2005 7:36 pm
by kendall
Hey,

has anyone ever used the DOM XML with PHP 4.3.10?

i am developing an application where php periodically updates and XML file which FLASH reads.

My concern is....will FLASH hang or error if it is trying to read an xml file while PHP is updating it?

which brings me to my next question....
how does the php DOM XML open_file and append_child functions work in terms of appending information to an xml file...is it more or less the same process as if you were fwrite() to the xml file?
Kendall

Posted: Thu Nov 03, 2005 7:43 pm
by timvw
If you generate the XML from a database, you should use transactions (with a decent isolation level), to make sure both sides get "valid/consistent" data. I believe a filesystem does this automagically for you (unless you asked otherwise).

DOM XML and FLASH

Posted: Thu Nov 03, 2005 7:54 pm
by kendall
you should use transactions (with a decent isolation level),
:?: :?: :?: huh?
i was thinking about that...you know run a daily cron job. but i think i wud do it via on a POST and do a domxml proceedure
believe a filesystem does this automagically for you (unless you asked otherwise).
what do you mean a filesystem?

Kendall

Re: DOM XML and FLASH

Posted: Thu Nov 03, 2005 8:42 pm
by John Cartwright
kendall wrote:
you should use transactions (with a decent isolation level),
:?: :?: :?: huh?
http://dev.mysql.com/doc/refman/5.1/en/ ... mands.html

Posted: Thu Nov 03, 2005 8:43 pm
by timvw
Here are a couple of articles that explain the problems that might arise:

http://en.wikipedia.org/wiki/Isolation_ ... r_science)
http://www.windowsitpro.com/Articles/In ... ab=Article
http://www.expresscomputeronline.com/20 ... ce01.shtml
http://www.databasejournal.com/features ... _3393161_1

As you simply generate a file, you have to make sure:

- No-one is allowed to read the file while there is someone writing/changing it.
- No-one is allowed to write/change the file if there is someone reading it.

I believe you can achieve that with http://www.php.net/flock.