You are here: Re: application level database connection « PHP Programming Language « IT news, forums, messages
Re: application level database connection

Posted by David T. Ashley on 11/16/06 16:46

"rich" <rbrooks@gmail.com> wrote in message
news:1163690515.482621.145940@b28g2000cwb.googlegroups.com...
> My question is is there a way to make a connection to mysql that
> multiple instances of an object will use together? I'm under the
> impression that something like a singleton would only live on a per
> instance basis, or am I incorrect?

We'd all need to know a little bit more about your application, and whether
the updates have to be done right away.

The obvious solution that comes to mind is just to have each PHP web process
append to a file, and have a separate daemon that flushes the file to the
database. Unix file semantics guarantee that there is a way to do this with
guaranteed results (for example, the daemon mv's the file then operates on
it ... this guarantees that any append operations either occur before or
after the mv but won't collide with it).

You could have the daemon just look at the file from time to time (once a
second?), or you could use a more fancy triggering mechanism.

They key design factor seems to be whether the database updates have to
complete by the time the PHP web script ends ...

Dave.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация