using DOM XML and FLASH

XML, Perl, Python, and other languages can be discussed here, even if it isn't PHP (We might forgive you).

Moderator: General Moderators

Post Reply
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

using DOM XML and FLASH

Post 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
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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).
User avatar
kendall
Forum Regular
Posts: 852
Joined: Tue Jul 30, 2002 10:21 am
Location: Trinidad, West Indies
Contact:

DOM XML and FLASH

Post 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
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Re: DOM XML and FLASH

Post 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
timvw
DevNet Master
Posts: 4897
Joined: Mon Jan 19, 2004 11:11 pm
Location: Leuven, Belgium

Post 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.
Post Reply