[PHP-DOC] cvs: phpdoc /en/features persistent-connections.xml
sp Tue Oct 28 10:20:18 2003 EDT Modified files: /phpdoc/en/features persistent-connections.xml Log: Fixed bug # 26018 -Fixed typos -Some text changes Index: phpdoc/en/features/persistent-connections.xml diff -u phpdoc/en/features/persistent-connections.xml:1.22 phpdoc/en/features/persistent-connections.xml:1.23 --- phpdoc/en/features/persistent-connections.xml:1.22 Tue Sep 2 18:52:27 2003 +++ phpdoc/en/features/persistent-connections.xml Tue Oct 28 10:20:18 2003 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.22 $ -- +!-- $Revision: 1.23 $ -- chapter id=features.persistent-connections titlePersistent Database Connections/title @@ -48,13 +48,10 @@ work of serving up web pages. When each request comes in from a client, it is handed off to one of the children that is not already serving another client. This means that when the same client makes - a second request to the server, it may be serviced by a different - child process than the first time. What a persistent connection - does for you in this case it make it so each child process only - needs to connect to your SQL server the first time that it serves a - page that makes use of such a connection. When another page then - requires a connection to the SQL server, it can reuse the - connection that child established earlier. + a second request to the server, it may be served by a different + child process than the first time. When opening a persistent connection, + every following page requesting SQL services can reuse the same + entsablished connection to the SQL server. /simpara simpara The last method is to use PHP as a plug-in for a multithreaded web
[PHP-DOC] cvs: phpdoc /en/features persistent-connections.xml
sp Tue Oct 28 10:24:04 2003 EDT Modified files: /phpdoc/en/features persistent-connections.xml Log: Overlooked small typo Index: phpdoc/en/features/persistent-connections.xml diff -u phpdoc/en/features/persistent-connections.xml:1.23 phpdoc/en/features/persistent-connections.xml:1.24 --- phpdoc/en/features/persistent-connections.xml:1.23 Tue Oct 28 10:20:18 2003 +++ phpdoc/en/features/persistent-connections.xml Tue Oct 28 10:24:04 2003 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.23 $ -- +!-- $Revision: 1.24 $ -- chapter id=features.persistent-connections titlePersistent Database Connections/title @@ -45,13 +45,13 @@ multiprocess web server, which currently only includes Apache. A multiprocess server typically has one process (the parent) which coordinates a set of processes (its children) who actually do the - work of serving up web pages. When each request comes in from a + work of serving up web pages. When a request comes in from a client, it is handed off to one of the children that is not already serving another client. This means that when the same client makes a second request to the server, it may be served by a different child process than the first time. When opening a persistent connection, every following page requesting SQL services can reuse the same - entsablished connection to the SQL server. + established connection to the SQL server. /simpara simpara The last method is to use PHP as a plug-in for a multithreaded web
Re: [PHP-DOC] cvs: phpdoc /en/features persistent-connections.xml
+ entsablished connection to the SQL server. another tipo
Re: [PHP-DOC] cvs: phpdoc /en/features persistent-connections.xml
Already fixed by Sebastian ;) didou Nuno Lopes wrote: + entsablished connection to the SQL server. another tipo
[PHP-DOC] cvs: phpdoc /en/features persistent-connections.xml
sniper Tue Sep 2 18:52:27 2003 EDT Modified files: /phpdoc/en/features persistent-connections.xml Log: imap_popen() does not exist anymore, and it never worked anyway Index: phpdoc/en/features/persistent-connections.xml diff -u phpdoc/en/features/persistent-connections.xml:1.21 phpdoc/en/features/persistent-connections.xml:1.22 --- phpdoc/en/features/persistent-connections.xml:1.21 Tue Feb 4 08:05:06 2003 +++ phpdoc/en/features/persistent-connections.xml Tue Sep 2 18:52:27 2003 @@ -1,10 +1,10 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.21 $ -- +!-- $Revision: 1.22 $ -- chapter id=features.persistent-connections titlePersistent Database Connections/title simpara - Persistent connections are SQL links that do not close when the + Persistent connections are links that do not close when the execution of your script ends. When a persistent connection is requested, PHP checks if there's already an identical persistent connection (that remained open from earlier) - and if it exists, it @@ -12,17 +12,11 @@ connection is a connection that was opened to the same host, with the same username and the same password (where applicable). /simpara - note - para -There are other extensions that provide persistent connections, such as -the link linkend=ref.imapIMAP extension/link. - /para - /note simpara People who aren't thoroughly familiar with the way web servers work and distribute the load may mistake persistent connects for what they're not. In particular, they do emphasisnot/emphasis give - you an ability to open 'user sessions' on the same SQL link, they + you an ability to open 'user sessions' on the same link, they do emphasisnot/emphasis give you an ability to build up a transaction efficiently, and they don't do a whole lot of other things. In fact, to be extremely clear about the subject, @@ -134,7 +128,7 @@ para See also functionfbsql_pconnect/function, functionibase_pconnect/function, functionifx_pconnect/function, - functionimap_popen/function, functioningres_pconnect/function, + functioningres_pconnect/function, functionmsql_pconnect/function, functionmssql_pconnect/function, functionmysql_pconnect/function, functionociplogon/function, functionodbc_pconnect/function, functionora_plogon/function,
[PHP-DOC] cvs: phpdoc-pl /features persistent-connections.xml
leszek Sat Jun 22 04:27:19 2002 EDT Modified files: /phpdoc-pl/features persistent-connections.xml Log: [leszek] Imported from main CVS Index: phpdoc-pl/features/persistent-connections.xml diff -u phpdoc-pl/features/persistent-connections.xml:1.9 phpdoc-pl/features/persistent-connections.xml:1.10 --- phpdoc-pl/features/persistent-connections.xml:1.9 Fri Jun 21 18:42:12 2002 +++ phpdoc-pl/features/persistent-connections.xml Sat Jun 22 04:27:19 2002 -1,6 +1,6 ?xml version=1.0 encoding=iso-8859-2? !-- EN-Revision: 1.19 Maintainer: slawek Status: ready -- -!-- $Revision: 1.9 $ -- +!-- $Revision: 1.10 $ -- chapter id=features.persistent-connections titleSta³e po³±czenia z bazami danych/title
[PHP-DOC] cvs: phpdoc-pl /features persistent-connections.xml
slawek Fri Jun 21 18:42:12 2002 EDT Modified files: /phpdoc-pl/features persistent-connections.xml Log: EN-Revision++ Index: phpdoc-pl/features/persistent-connections.xml diff -u phpdoc-pl/features/persistent-connections.xml:1.8 phpdoc-pl/features/persistent-connections.xml:1.9 --- phpdoc-pl/features/persistent-connections.xml:1.8 Sun Mar 17 10:03:49 2002 +++ phpdoc-pl/features/persistent-connections.xml Fri Jun 21 18:42:12 2002 -1,6 +1,6 ?xml version=1.0 encoding=iso-8859-2? -!-- EN-Revision: 1.18 Maintainer: slawek Status: ready -- -!-- $Revision: 1.8 $ -- +!-- EN-Revision: 1.19 Maintainer: slawek Status: ready -- +!-- $Revision: 1.9 $ -- chapter id=features.persistent-connections titleSta³e po³±czenia z bazami danych/title
[PHP-DOC] cvs: phpdoc-cs /features persistent-connections.xml
costra Sat Jun 8 11:37:00 2002 EDT Modified files: /phpdoc-cs/features persistent-connections.xml Log: Updated translation Modified Files: persistent-connections.xml (en rev. 1.19) Index: phpdoc-cs/features/persistent-connections.xml diff -u phpdoc-cs/features/persistent-connections.xml:1.6 phpdoc-cs/features/persistent-connections.xml:1.7 --- phpdoc-cs/features/persistent-connections.xml:1.6 Thu Mar 7 18:25:03 2002 +++ phpdoc-cs/features/persistent-connections.xml Sat Jun 8 11:36:59 2002 -12,12 +12,19 které bylo otevøeno se stejným serverem, u¾ivatelským jménem a heslem (pokud je zadáte). /simpara +note + para + Existují i dalí rozíøení, která vytváøí trvalá spojení, + napøíklad +link linkend=ref.imapRozíøení IMAP/link. + /para + /note simpara Lidé, kteøí nejsou dùkladnì obeznámeni se zpùsobem, jakým web servery fungují - a distribuují zátì¾ mohou pokládat trvalá spojení za nìco èím nejsou. Zvlá¹tì + a distribuují zátì¾, mohou pokládat trvalá spojení za nìco èím nejsou. Zvlá¹tì emphasisneumo¾òují/emphasis otvírání u¾ivatelských sessions na stejném SQL spojení, emphasisneumo¾òují/emphasis efektivní tvorbu transakcí, a - neumo¾òují spoustu dal¹ích vìcí. Dokonce, aby bylo opravdu a dúkladnì jasno, + neumo¾òují spoustu dal¹ích vìcí. Dokonce, aby o tom bylo opravdu a dùkladnì jasno, vám trvalá spojení nedají emphasis¾ádnou/emphasis funkcionalitu, která by nebyla mo¾ná s jejich netrvalými protìj¹ky. /simpara -31,7 +38,7 simpara První metodou je pou¾ít PHP jako CGI obal. V tomto re¾imu se vytváøí a nièí jedna instance PHP interpretru pro ka¾dý po¾adavek (na PHP strnánku) - na va¹em web serveru. Proto¾e je znièna po obslou¾ení po¾adavku, v¹echny + na va¹em web serveru. Proto¾e je znièena po obslou¾ení po¾adavku, v¹echny zdroje, které získá (jako tøeba spojení s databázovým serverem) jsou pøi jejím znièení zavøeny. V tomto pøípadì pokusem o pou¾ití trvalých spojení nic nezískáte - prostì nevydr¾í. -39,7 +46,7 simpara Druhou, a nejpopulárnìj¹í, metodou, je provozovat PHP jako modul v multiprocesním web serveru, co¾ je mno¾ina, která v souèasnosti obsahuje - pouze Apache. Multiprocesní web serveru má typicky jeden proces (rodièe), + pouze Apache. Multiprocesní web server má typicky jeden proces (rodièe), který øídí skupinu procesù (svých dìtí), které dìlají vlastní práci - servírují stránky. Ka¾dý po¾adavek, který pøijde od klienta, je obslou¾en jedním z dìtí, které právì neobsluhuje jiného klienta. To znamená, ¾e kdy¾ -51,13 +58,11 døíve. /simpara simpara - Poslední metodou je pou¾ít PHP jako plugin v multithreadovém web serveru. To - je v souèasností pouhá teorie - PHP je¹tì nefunguje jako plagin v ¾ádném - multithreadovém web serveru. Pracuje se na podpoøe ISAPI, WSAPI a NSAPI (na - Windows), co¾ umo¾ní pou¾ívat PHP jako plugin v multithreadových serverech - jako Netscape FastTrack, Microsoft Internet Information Server (IIS), - a O'Reilly's WebSite Pro. A¾ k tomu dojde, chování bude v podstatì stejné - jako u multiprocesním modelu popsaném døíve. + Poslední metodou je pou¾ít PHP jako plug-in v multivláknovém web serveru. Aktuálnì +PHP 4 má tuto podporu pro ISAPI, WSAPI a NSAPI + (na Windows), co¾ umo¾nuje pou¾ívat PHP jako plug-in v multivláknových serverech + jako Netscape FastTrack (iPlanet), Microsoft Internet Information Server (IIS), + a O'Reilly's WebSite Pro. Chování je stejné + jako u multiprocesním modelu popsaném døíve. Podpora pro SAPI není dostupná v PHP 3. /simpara simpara Pokud trvalá spojení neposkytují ¾ádnou pøidanou funkcionalitu, k èemu jsou -86,6 +91,25 pouhými 32 spojeními bude brzy zaplavena. Vyhledejte si v dokumentaci va¹í databáze informace o obsluze opu¹tìných nebo neèinných spojení. /simpara +warning + simpara + Zde je nìkolik dodateèných námitek, které se usadily v mysli bìhem + pouívání trvalých spojení. Jedna z nich je, kdy pouíváte zamknuté + tabulky pøi trvalém spojení a skript z jakéhokoli dùvodu nemùe + uvolnit zámek, pak následující skript, který pouívá stejné spojení, + bude nejspíe na trvalo zablokován a moná bude nutné, abyste + pokadé restartovali http server nebo databázový server. + Dále pak v pøípadì pouití transakcí se transakèní blok pøenese i do + dalího skriptu pouívajícího stejné spojení, pokud jeho vykonání + konèí døíve ne transakèní blok. V kadém pøípadì mùete pouít + functionregister_shutdown_function/function k registraci a + jednoduchému vyèitìní funkce pro odemknutí tabulek nebo zruení + bìící transakce (roll back). Nejlépe se problému vyvarujete úplnì + nepouíváním trvalých spojení ve skriptech, ve kterých se zamykají + tabulky nebo pouívají transakce (mùete je stále pouívat na + mnohých dalích místech). + /simpara + /warning simpara Dùle¾itý souhrn. Trvalá spojení byla navr¾ena tak,
[PHP-DOC] cvs: phpdoc-cs /features persistent-connections.xml
costra Sat Jun 8 11:50:35 2002 EDT Modified files: /phpdoc-cs/features persistent-connections.xml Log: I forgot convert charset win-iso Modified Files: persistent-connections.xml Index: phpdoc-cs/features/persistent-connections.xml diff -u phpdoc-cs/features/persistent-connections.xml:1.7 phpdoc-cs/features/persistent-connections.xml:1.8 --- phpdoc-cs/features/persistent-connections.xml:1.7 Sat Jun 8 11:36:59 2002 +++ phpdoc-cs/features/persistent-connections.xml Sat Jun 8 11:50:35 2002 -14,9 +14,9 /simpara note para - Existují i dalí rozíøení, která vytváøí trvalá spojení, + Existují i dal¹í roz¹íøení, která vytváøí trvalá spojení, napøíklad -link linkend=ref.imapRozíøení IMAP/link. +link linkend=ref.imapRoz¹íøení IMAP/link. /para /note simpara -94,20 +94,20 warning simpara Zde je nìkolik dodateèných námitek, které se usadily v mysli bìhem - pouívání trvalých spojení. Jedna z nich je, kdy pouíváte zamknuté - tabulky pøi trvalém spojení a skript z jakéhokoli dùvodu nemùe - uvolnit zámek, pak následující skript, který pouívá stejné spojení, - bude nejspíe na trvalo zablokován a moná bude nutné, abyste - pokadé restartovali http server nebo databázový server. - Dále pak v pøípadì pouití transakcí se transakèní blok pøenese i do - dalího skriptu pouívajícího stejné spojení, pokud jeho vykonání - konèí døíve ne transakèní blok. V kadém pøípadì mùete pouít + pou¾ívání trvalých spojení. Jedna z nich je, kdy¾ pou¾íváte zamknuté + tabulky pøi trvalém spojení a skript z jakéhokoli dùvodu nemù¾e + uvolnit zámek, pak následující skript, který pou¾ívá stejné spojení, + bude nejspí¹e na trvalo zablokován a mo¾ná bude nutné, abyste + poka¾dé restartovali http server nebo databázový server. + Dále pak v pøípadì pou¾ití transakcí se transakèní blok pøenese i do + dal¹ího skriptu pou¾ívajícího stejné spojení, pokud jeho vykonání + konèí døíve ne¾ transakèní blok. V ka¾dém pøípadì mù¾ete pou¾ít functionregister_shutdown_function/function k registraci a - jednoduchému vyèitìní funkce pro odemknutí tabulek nebo zruení - bìící transakce (roll back). Nejlépe se problému vyvarujete úplnì - nepouíváním trvalých spojení ve skriptech, ve kterých se zamykají - tabulky nebo pouívají transakce (mùete je stále pouívat na - mnohých dalích místech). + jednoduchému vyèi¹tìní funkce pro odemknutí tabulek nebo zru¹ení + bì¾ící transakce (roll back). Nejlépe se problému vyvarujete úplnì + nepou¾íváním trvalých spojení ve skriptech, ve kterých se zamykají + tabulky nebo pou¾ívají transakce (mù¾ete je stále pou¾ívat na + mnohých dal¹ích místech). /simpara /warning simpara
[PHP-DOC] cvs: phpdoc-it /features persistent-connections.xml
cortesi Sun Jun 2 11:17:45 2002 EDT Modified files: /phpdoc-it/features persistent-connections.xml Log: just EN-Revision tag fix Index: phpdoc-it/features/persistent-connections.xml diff -u phpdoc-it/features/persistent-connections.xml:1.10 phpdoc-it/features/persistent-connections.xml:1.11 --- phpdoc-it/features/persistent-connections.xml:1.10 Thu Jan 10 11:16:56 2002 +++ phpdoc-it/features/persistent-connections.xml Sun Jun 2 11:17:45 2002 -1,5 +1,5 ?xml version=1.0 encoding=iso-8859-1? -!-- EN-Revision: 1.18 Maintainer: cortesi Status: ready -- +!-- EN-Revision: 1.19 Maintainer: cortesi Status: ready -- chapter id=features.persistent-connections titleConnessioni Persistenti ai Database/title
[PHP-DOC] cvs: phpdoc-es /features persistent-connections.xml
rafael Thu May 30 17:39:08 2002 EDT Modified files: /phpdoc-es/features persistent-connections.xml Log: Fix typo Index: phpdoc-es/features/persistent-connections.xml diff -u phpdoc-es/features/persistent-connections.xml:1.5 phpdoc-es/features/persistent-connections.xml:1.6 --- phpdoc-es/features/persistent-connections.xml:1.5 Thu May 30 17:24:49 2002 +++ phpdoc-es/features/persistent-connections.xml Thu May 30 17:39:07 2002 -129,9 +129,9 posteriores que usen esta conexioacute;n, quedaraacute;n bloqueados indefiniacute;damente y se requeriraacute; que, oacute; bien el servidor httpd oacute; la base de datos sean arrancados de nuevo. -La segunda, cuando utiliceis transacciones. Un bloqueo por transaccioacute;n -seraacute; heredado por el proacute;ximo script usando la coneccioacute;n, si la ejecucioacute;n del -primer script termina antes que el bloqueo. en anbos caso podeis +La segunda, cuando utiliceis transacciones, un bloqueo por transaccioacute;n +seraacute; heredado por el proacute;ximo script usando la conexioacute;n, si +la ejecucioacute;n del +primer script termina antes que el bloqueo. en ambos caso podeis utilizar functionregister_shutdown_function/function para registrar una funcion simple de limpieza que desbloquee las tablas oacute; deshaga la transaccioacute;n. Lo mejor para evitar problemas es no usar
[PHP-DOC] cvs: phpdoc-de /features persistent-connections.xml
tom Wed May 22 17:40:19 2002 EDT Modified files: /phpdoc-de/features persistent-connections.xml Log: sync to en Index: phpdoc-de/features/persistent-connections.xml diff -u phpdoc-de/features/persistent-connections.xml:1.7 phpdoc-de/features/persistent-connections.xml:1.8 --- phpdoc-de/features/persistent-connections.xml:1.7 Wed Dec 12 15:46:06 2001 +++ phpdoc-de/features/persistent-connections.xml Wed May 22 17:40:19 2002 -1,4 +1,5 ?xml version=1.0 encoding=iso-8859-1? +!-- EN-Revision: 1.19 Maintainer: tom Status: ready -- chapter id=features.persistent-connections titlePersistente Datenbankverbindungen/title -12,103 +13,147 'identische' Verbindung ist eine Verbindung, die zu dem gleichen Host mit dem gleichen Usernamen und Passwort hergestellt wurde./simpara - - simpara - Wer nicht durchgängig mit der Art und Weise, wie - Webserver arbeiten und die Last verteilen, vertraut ist, könnte - missverstehen, wofür persistente Verbindungen gedacht sind. - Im Besonderen bieten sie emphasiskeine/emphasis - Möglichkeit, 'Benutzersitzungen' auf der gleichen SQL-Verbindung - zu öffnen und emphasiskeine/emphasis Möglichkeit, eine - Transaktion aufzubauen, und sie können viele - andere Sachen nicht. Um absulute Klarheit zu schaffen: - Persistente Verbindungen bieten emphasiskeine/emphasis - Funktionalität, die nicht auch von nicht-persistenten Verbindungen - bereitgestellt wird./simpara - + note + para +Auch andere Erweiterungen bieten persistente Verbindungen, wie z.B. +link linkend=ref.imapIMAP extension/link. + /para + /note + simpara + Wer nicht durchgängig mit der Art und Weise vertraut ist, wie + Webserver arbeiten und die Last verteilen, könnte missverstehen, + wofür persistente Verbindungen gedacht sind. Im Besonderen bieten + sie emphasiskeine/emphasis Möglichkeit, 'Benutzersitzungen' + über die gleiche SQL-Verbindung zu öffnen und + emphasiskeine/emphasis Möglichkeit, eine Transaktion effizient + aufzubauen, und sie können auch viele andere Dinge nicht. Um + absolute Klarheit zu schaffen: Persistente Verbindungen bieten + emphasiskeine/emphasis Funktionalität, die nicht auch von + nicht-persistenten Verbindungen bereitgestellt wird. + /simpara simpara - Warum?/simpara - + Warum? + /simpara simpara Das hat mit der Arbeitsweise von Webservern zu tun. Es gibt drei Möglichkeiten, wie ein Webserver PHP zur Generierung von - Webseiten einsetzen kann./simpara - + Webseiten einsetzen kann. + /simpara simpara Die erste Methode ist, PHP als CGI-'Wrapper' zu benutzen. Wenn diese Methode eingesetzt wird, wird für jede Anfrage nach einer PHP-Seite vom Webserver eine Instanz des PHP- - Interpreters gestartet und anschliessend wieder beendet. + Interpreters gestartet und anschließend wieder beendet. Durch die Beendigung des Interpreters nach abgeschlossener Anfrage werden alle Ressourcen, auf die zugegriffen wurde (wie beispielsweise eine Verbindung zu einem SQL- - Datenbankserver) wieder geschlossen. In diesem - Fall erreicht man nichts, wenn man persistente Verbindungen - benutzt - sie sind eben nicht beständig./simpara - - simpara - Die zweite und populärere Methode ist der Einsatz von PHP als - Modul in einem Multiprozess-Webserver, was momentan nur - auf den Apache zutrifft. Typischerweise hat ein Multiprozess- - Webserver einen Prozess (den 'Eltern' Prozess), der einen Satz - weiterer Prozesse (die 'Kinder') koordiniert, die die eigentliche Arbeit - des Bereitstellens der Seiten übenehmen. Jede Anfrage, die von - einen Client erfolgt, wird an einen untergeordneten Prozess, der + Datenbankserver) wieder geschlossen. In diesem Fall erreicht + man nichts, wenn man persistente Verbindungen benutzt - sie + sind eben nicht beständig. + /simpara + simpara + Die zweite und populärste Methode ist der Einsatz von PHP als + Modul in einem Multiprozess-Webserver, was momentan nur auf den + Apache zutrifft. Typischerweise hat ein Multiprozess-Webserver + einen Prozess (den 'Eltern' Prozess), der einen Satz weiterer + Prozesse (die 'Kinder') koordiniert, welche die eigentliche Arbeit + des Bereitstellens der Seiten übernehmen. Jede Anfrage, die von + einem Client erfolgt, wird an einen untergeordneten Prozess, der noch keine andere Anfrage bearbeitet, weitergereicht. Das bedeutet, - dass eine zweite Anfrage des Clients an den Server unter + dass eine zweite Anfrage des gleichen Clients an den Server unter Umständen von einem anderen untergeordneten Prozess als die erste Anfrage bearbeitet wird. In diesem Fall sorgt eine persistente Verbindung dafür, dass jeder untergeordnete Prozess sich nur einmal mit dem SQL-Server verbinden muss, wenn eine solche benötigt wird. Benötigt dann eine weitere Seite die Verbindung mit dem SQL-Server, kann auf die zurückgegriffen
[PHP-DOC] cvs: phpdoc /en/features persistent-connections.xml
tom Wed May 15 16:46:34 2002 EDT Modified files: /phpdoc/en/features persistent-connections.xml Log: typo Index: phpdoc/en/features/persistent-connections.xml diff -u phpdoc/en/features/persistent-connections.xml:1.18 phpdoc/en/features/persistent-connections.xml:1.19 --- phpdoc/en/features/persistent-connections.xml:1.18 Wed Jan 9 20:56:08 2002 +++ phpdoc/en/features/persistent-connections.xml Wed May 15 16:46:33 2002 -1,5 +1,5 ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.18 $ -- +!-- $Revision: 1.19 $ -- chapter id=features.persistent-connections titlePersistent Database Connections/title -58,7 +58,7 child process than the first time. What a persistent connection does for you in this case it make it so each child process only needs to connect to your SQL server the first time that it serves a - page that makes us of such a connection. When another page then + page that makes use of such a connection. When another page then requires a connection to the SQL server, it can reuse the connection that child established earlier. /simpara
[PHP-DOC] cvs: phpdoc /pl/features persistent-connections.xml
slawek Sun Mar 17 10:03:49 2002 EDT Modified files: /phpdoc/pl/features persistent-connections.xml Log: Updated to EN 1.18 Index: phpdoc/pl/features/persistent-connections.xml diff -u phpdoc/pl/features/persistent-connections.xml:1.7 phpdoc/pl/features/persistent-connections.xml:1.8 --- phpdoc/pl/features/persistent-connections.xml:1.7 Thu Dec 20 07:41:37 2001 +++ phpdoc/pl/features/persistent-connections.xml Sun Mar 17 10:03:49 2002 -1,6 +1,6 ?xml version=1.0 encoding=iso-8859-2? -!-- EN-Revision: 1.14 Maintainer: slawek Status: ready -- -!-- $Revision: 1.7 $ -- +!-- EN-Revision: 1.18 Maintainer: slawek Status: ready -- +!-- $Revision: 1.8 $ -- chapter id=features.persistent-connections titleSta³e po³±czenia z bazami danych/title -12,6 +12,12 jest nowe. Po³±czenie 'identyczne' to po³±czenie z tym samym hostem, z tak± sam± nazw± u¿ytkownika i has³em. /simpara + note + para +Istniej± tak¿e inne modu³y udostêpniaj±ce sta³e po³±czenia, na przyk³ad +link linkend=ref.imapIMAP/link. + /para + /note simpara Ludzie niezbyt dobrze znaj±cy zasady dzia³ania serwerów mog± czasem braæ sta³e po³±czenia za co¶, czym te nie s±. Sta³e po³±czenia -89,14 +95,39 zapchana. Poszukaj w dokumentacji swojej bazy danych w jaki sposób radzi sobie ona z porzuconymi lub bezczynnymi po³±czeniami. /simpara + warning + simpara +Istnieje kilka zagro¿eñ, które nale¿y braæ pod uwagê decyduj±c siê na +u¿ywanie sta³ych po³±czeñ. Jednym z nich jest sytuacja, w której skrypt +blokuj±cy tabelê, z jakiegokolwiek powodu nie mo¿e zdj±æ blokady. Wtedy +kolejne skrypty korzystaj±ce z tego samego po³±czenia bêd± zablokowane i +mo¿e zaj¶æ potrzeba ponownego uruchomienia serwera httpd lub serwera bazy +danych. Kolejne zagro¿enie dotyczy transakcji. Je¶li skrypt u¿ywaj±cy +transakcji zakoñczy dzia³anie przed zakoñczeniem bloku transakcji, to +zostanie on (blok) przeniesiony do nastêpnego skryptu. W obu przypadkach +mo¿na u¿yæ functionregister_shutdown_function/function, aby +zarejestrowaæ funkcjê porz±dkuj±c±, która odblokuje tabele lub wycofa +transakcje. Najlepiej jednak jest zrezygnowaæ ze sta³ych po³±czeñ w +skryptach u¿ywaj±cych blokowania tabel lub transakcji. + /simpara + /warning simpara - Wa¿ne podsumowanie. Sta³e po³±czenia zosta³y zaprojektowane tak, by + Istotne podsumowanie. Sta³e po³±czenia zosta³y zaprojektowane tak, by odpowiadaæ zwyk³ym po³±czeniom. Oznacza to, ¿e emphasiszawsze/emphasis mo¿esz zast±piæ sta³e po³±czenia zwyk³ymi i nie zmieni to zachowania - skryptu. Natomiast emphasismo¿e/emphasis zmieniæ (i pewnie zmieni) + skryptu. Natomiast emphasismo¿e/emphasis zmieniæ (i zapewne zmieni) jego wydajno¶æ! /simpara - + para + Zobacz tak¿e functionfbsql_pconnect/function, + functionibase_pconnect/function, functionifx_pconnect/function, + functionimap_popen/function, functioningres_pconnect/function, + functionmsql_pconnect/function, functionmssql_pconnect/function, + functionmysql_pconnect/function, functionOCIPLogon/function, + functionodbc_pconnect/function, functionOra_pLogon/function, + functionpfsockopen/function, functionpg_pconnect/function i + functionsybase_pconnect/function. + /para /chapter !-- Keep this comment at the end of the file -108,6 +139,7 sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t +indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:../../manual.ced sgml-exposed-tags:nil
[PHP-DOC] cvs: phpdoc /hu/features persistent-connections.xml
gerzson Wed Feb 13 11:40:19 2002 EDT Modified files: /phpdoc/hu/features persistent-connections.xml Log: sync to EN revision Index: phpdoc/hu/features/persistent-connections.xml diff -u phpdoc/hu/features/persistent-connections.xml:1.8 phpdoc/hu/features/persistent-connections.xml:1.9 --- phpdoc/hu/features/persistent-connections.xml:1.8 Sat Dec 22 11:58:36 2001 +++ phpdoc/hu/features/persistent-connections.xml Wed Feb 13 11:40:19 2002 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-2? -!-- EN-Revision: 1.17 Maintainer: goba Status: ready -- +!-- EN-Revision: 1.18 Maintainer: goba Status: ready -- chapter id=features.persistent-connections titleÁllandó adatbázis kapcsolatok/title @@ -159,7 +159,7 @@ Lásd még functionfbsql_pconnect/function, functionibase_pconnect/function, functionifx_pconnect/function, functionimap_popen/function, functioningres_pconnect/function, - functionmsql_pconnect/function, functionmssql_pconnection/function, + functionmsql_pconnect/function, functionmssql_pconnect/function, functionmysql_pconnect/function, functionOCIPLogon/function, functionodbc_pconnect/function, functionOra_pLogon/function, functionpfsockopen/function, functionpg_pconnect/function, és
[PHP-DOC] cvs: phpdoc /it/features persistent-connections.xml /it/functions math.xml
cortesi Thu Jan 10 11:16:56 2002 EDT Modified files: /phpdoc/it/features persistent-connections.xml /phpdoc/it/functionsmath.xml Log: update to current EN versions Index: phpdoc/it/features/persistent-connections.xml diff -u phpdoc/it/features/persistent-connections.xml:1.9 phpdoc/it/features/persistent-connections.xml:1.10 --- phpdoc/it/features/persistent-connections.xml:1.9 Wed Dec 19 04:50:12 2001 +++ phpdoc/it/features/persistent-connections.xml Thu Jan 10 11:16:56 2002 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- EN-Revision: 1.17 Maintainer: cortesi Status: ready -- +!-- EN-Revision: 1.18 Maintainer: cortesi Status: ready -- chapter id=features.persistent-connections titleConnessioni Persistenti ai Database/title @@ -134,7 +134,16 @@ probabilmente succederà) cambiare l'efficienza dello script, ma non il suo comportamento! /simpara - + para + Vedere anche functionfbsql_pconnect/function, + functionibase_pconnect/function, functionifx_pconnect/function, + functionimap_popen/function, functioningres_pconnect/function, + functionmsql_pconnect/function, functionmssql_pconnect/function, + functionmysql_pconnect/function, functionOCIPLogon/function, + functionodbc_pconnect/function, functionOra_pLogon/function, + functionpfsockopen/function, functionpg_pconnect/function e + functionsybase_pconnect/function. + /para /chapter !-- Keep this comment at the end of the file Index: phpdoc/it/functions/math.xml diff -u phpdoc/it/functions/math.xml:1.20 phpdoc/it/functions/math.xml:1.21 --- phpdoc/it/functions/math.xml:1.20 Sat Jan 5 10:45:22 2002 +++ phpdoc/it/functions/math.xmlThu Jan 10 11:16:56 2002 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- EN-Revision: 1.64 Maintainer: cortesi Status: ready -- +!-- EN-Revision: 1.67 Maintainer: cortesi Status: ready -- reference id=ref.math titleFunzioni Matematiche/title titleabbrevMat/titleabbrev @@ -145,6 +145,16 @@ altrimenti restituisce un typeinteger/type (percheacute; typefloat/type di solito ha un range di valori piugrave; grande di typeinteger/type). /para +example + titleEsempio di functionabs/function/title + programlisting role=php +![CDATA[ +$abs = abs(-4.2); // $abs = 4.2; (double/float) +$abs2 = abs(5); // $abs2 = 5; (integer) +$abs3 = abs(-5); // $abs3 = 5; (integer) +]] + /programlisting +/example /refsect1 /refentry @@ -413,6 +423,15 @@ typefloat/type, poicheacute; la gamma di valori del tipo typefloat/type egrave; solitamente piugrave; grande di quella del tipo typeint/type. /simpara +example + titleEsempio di functionceil/function/title + programlisting role=php +![CDATA[ +$cinque = ceil(4.3); // $cinque = 5.0; +$dieci = ceil(9.999); // $dieci = 10.0; +]] + /programlisting +/example simpara Vedere anche functionfloor/function e functionround/function. @@ -629,7 +648,7 @@ solitamente piugrave; grande di quella del tipo typeint/type. /simpara example - titleEsempi di functionfloor/function/title + titleEsempio di functionfloor/function/title programlisting role=php ![CDATA[ $quattro = floor(4.3); // $quattro = 4.0; @@ -1219,7 +1238,7 @@ /para /warning para - Vedere anche functionexp/function. + Vedere anche functionexp/function e functionsqrt/function. /para /refsect1 /refentry
[PHP-DOC] cvs: phpdoc /en/features persistent-connections.xml
irc-htmlWed Jan 9 20:56:08 2002 EDT Modified files: /phpdoc/en/features persistent-connections.xml Log: fixed reference to mssql_pconnect, spelling errors Index: phpdoc/en/features/persistent-connections.xml diff -u phpdoc/en/features/persistent-connections.xml:1.17 phpdoc/en/features/persistent-connections.xml:1.18 --- phpdoc/en/features/persistent-connections.xml:1.17 Tue Dec 18 15:49:03 2001 +++ phpdoc/en/features/persistent-connections.xml Wed Jan 9 20:56:08 2002 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.17 $ -- +!-- $Revision: 1.18 $ -- chapter id=features.persistent-connections titlePersistent Database Connections/title @@ -24,7 +24,7 @@ they're not. In particular, they do emphasisnot/emphasis give you an ability to open 'user sessions' on the same SQL link, they do emphasisnot/emphasis give you an ability to build up a - transaction efficently, and they don't do a whole lot of other + transaction efficiently, and they don't do a whole lot of other things. In fact, to be extremely clear about the subject, persistent connections don't give you emphasisany/emphasis functionality that wasn't possible with their non-persistent @@ -135,7 +135,7 @@ See also functionfbsql_pconnect/function, functionibase_pconnect/function, functionifx_pconnect/function, functionimap_popen/function, functioningres_pconnect/function, - functionmsql_pconnect/function, functionmssql_pconnection/function, + functionmsql_pconnect/function, functionmssql_pconnect/function, functionmysql_pconnect/function, functionOCIPLogon/function, functionodbc_pconnect/function, functionOra_pLogon/function, functionpfsockopen/function, functionpg_pconnect/function, and
[PHP-DOC] cvs: phpdoc /hu/features persistent-connections.xml remote-files.xml
gobaSat Dec 22 11:58:36 2001 EDT Modified files: /phpdoc/hu/features persistent-connections.xml remote-files.xml Log: Update to latest EN-Revisions Index: phpdoc/hu/features/persistent-connections.xml diff -u phpdoc/hu/features/persistent-connections.xml:1.7 phpdoc/hu/features/persistent-connections.xml:1.8 --- phpdoc/hu/features/persistent-connections.xml:1.7 Wed Dec 12 15:50:59 2001 +++ phpdoc/hu/features/persistent-connections.xml Sat Dec 22 11:58:36 2001 @@ -1,8 +1,8 @@ ?xml version=1.0 encoding=iso-8859-2? -!-- EN-Revision: 1.11 Maintainer: goba Status: ready -- +!-- EN-Revision: 1.17 Maintainer: goba Status: ready -- chapter id=features.persistent-connections - titleÁllandó (persistent) adatbázis kapcsolatok/title + titleÁllandó adatbázis kapcsolatok/title simpara Az állandó kapcsolatok SQL adatbázisokkal nem szûnnnek meg, @@ -13,6 +13,14 @@ A megegyezõ kapcsolat azt jelenti, hogy ugyanaz a host és ugyanaz a felhasználói név és jelszó került felhasználásra. /simpara + + note + para +Állandó kapcsolatokat nem csak adatbázisok szolgáltathatnak, +vannak más ilyen képességû kiterjesztések, mint például az +link linkend=ref.imapIMAP kiterjesztés/link. + /para + /note simpara Ha esetleg nem ismered alaposabban a webszerverek mûködését, @@ -67,7 +75,7 @@ 'multithreaded' web szerverben. Ez azt jelenti, hogy az ISAPI, WSAPI, és NSAPI (Windows alatt) formák használhatóak a PHP-vel. Ez a PHP 4.0.0 óta lehetséges, és így a PHP alkalmas - plug-in szintû együttmûködésre a Netscape FastTrack Server, + plug-in szintû együttmûködésre a Netscape FastTrack (iPlanet), a Microsoft Internet Information Server (IIS), és az O'Reilly WebSite Pro szerverekkel, valamint más, a fenti standardokat támogató szerverekkel. Ebben az esetben @@ -113,7 +121,30 @@ dokumentációjában, hogy hogyan tudod lekezelni az elhagyott vagy inaktív kapcsolatokat. /simpara - + + warning + simpara +Van még néhány faktor, amit érdemes figyelembe venned, +ha állandó adatbázis kapcsolatokat használsz. Egy ilyen +probléma, hogy ha tábla lezárást (lock) használsz egy +állandó kapcsolaton, és a szkript valamilyen okból nem +tudja feloldani a zárat, ezt a kapcsolatot használó +további szkriptek nem fognak helyesen mûködni, és a +webszerver vagy adatbázis szerver újraindítására lehet +szükség a feloldáshoz. Hasonlóan ha tranzakciókat használsz, +a tranzakció blokk tovább folytatódik a következõ megegyezõ +kapcsolatot használó szkriptben, ha a tranzakciót indító +szkript nem tudja lezárni azt. Ezekben az esetekben a +functionregister_shutdown_function/function függvényt +használhatod, hogy egy egyszerû takarító függvényt futtass +le a programod végeztével, ami visszavonja a tranzakciókat, +és feloldja a tábla zárakat. Jobban teszed azonban, ha +úgy kerülöd meg a problémát, hogy nem használsz állandó +kapcsolatokat olyan szkriptekben, amik tábla zárakat, +vagy tranzakciókat alkalmaznak. + /simpara + /warning + simpara Összefoglalva: az állandó adatbáziskapcsolatokat úgy tervezték, hogy megfeleltethetõek legyenek a hagyományos kapcsolatokkal. @@ -124,6 +155,17 @@ hatékonyságát, de a viselkedését nem! /simpara + para + Lásd még functionfbsql_pconnect/function, + functionibase_pconnect/function, functionifx_pconnect/function, + functionimap_popen/function, functioningres_pconnect/function, + functionmsql_pconnect/function, functionmssql_pconnection/function, + functionmysql_pconnect/function, functionOCIPLogon/function, + functionodbc_pconnect/function, functionOra_pLogon/function, + functionpfsockopen/function, functionpg_pconnect/function, és + functionsybase_pconnect/function. + /para + /chapter !-- Keep this comment at the end of the file @@ -137,9 +179,12 @@ sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil - sgml-default-dtd-file:../../manual.ced +sgml-default-dtd-file:../../manual.ced sgml-exposed-tags:nil sgml-local-catalogs:nil sgml-local-ecat-files:nil End: +vim600: syn=xml fen fdm=syntax fdl=2 si +vim: et tw=78 syn=sgml +vi: ts=1 sw=1 -- Index: phpdoc/hu/features/remote-files.xml diff -u phpdoc/hu/features/remote-files.xml:1.6 phpdoc/hu/features/remote-files.xml:1.7 --- phpdoc/hu/features/remote-files.xml:1.6 Wed Dec 12 15:51:00 2001 +++ phpdoc/hu/features/remote-files.xml Sat Dec 22 11:58:36 2001 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-2? -!-- EN-Revision: 1.9 Maintainer: goba Status: ready -- +!-- EN-Revision: 1.13 Maintainer: goba Status: ready -- chapter id=features.remote-files titleTávoli file-ok kezelése/title @@ -113,9 +113,12 @@ sgml-indent-data:t indent-tabs-mode:nil sgml-parent-document:nil - sgml-default-dtd-file:../../manual.ced +sgml-default-dtd-file:../../manual.ced sgml-exposed-tags:nil sgml-local-catalogs:nil
[PHP-DOC] cvs: phpdoc /pl/features persistent-connections.xml
leszek Thu Dec 20 07:41:37 2001 EDT Modified files: /phpdoc/pl/features persistent-connections.xml Log: Update Index: phpdoc/pl/features/persistent-connections.xml diff -u phpdoc/pl/features/persistent-connections.xml:1.6 phpdoc/pl/features/persistent-connections.xml:1.7 --- phpdoc/pl/features/persistent-connections.xml:1.6 Mon Dec 17 23:10:12 2001 +++ phpdoc/pl/features/persistent-connections.xml Thu Dec 20 07:41:37 2001 @@ -1,6 +1,6 @@ ?xml version=1.0 encoding=iso-8859-2? !-- EN-Revision: 1.14 Maintainer: slawek Status: ready -- -!-- $Revision: 1.6 $ -- +!-- $Revision: 1.7 $ -- chapter id=features.persistent-connections titleSta³e po³±czenia z bazami danych/title
[PHP-DOC] cvs: phpdoc /it/features persistent-connections.xml
cortesi Wed Dec 19 04:50:12 2001 EDT Modified files: /phpdoc/it/features persistent-connections.xml Log: error in Revision-comment corrected Index: phpdoc/it/features/persistent-connections.xml diff -u phpdoc/it/features/persistent-connections.xml:1.8 phpdoc/it/features/persistent-connections.xml:1.9 --- phpdoc/it/features/persistent-connections.xml:1.8 Wed Dec 19 04:47:23 2001 +++ phpdoc/it/features/persistent-connections.xml Wed Dec 19 04:50:12 2001 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- EN-Revision: 1.1 7 Maintainer: cortesi Status: ready -- +!-- EN-Revision: 1.17 Maintainer: cortesi Status: ready -- chapter id=features.persistent-connections titleConnessioni Persistenti ai Database/title
[PHP-DOC] cvs: phpdoc /en/features persistent-connections.xml
jimwTue Dec 18 15:49:03 2001 EDT Modified files: /phpdoc/en/features persistent-connections.xml Log: note there are some non-sql persistent connections, and provide a see also section with links to all the persistent connection functions. Index: phpdoc/en/features/persistent-connections.xml diff -u phpdoc/en/features/persistent-connections.xml:1.16 phpdoc/en/features/persistent-connections.xml:1.17 --- phpdoc/en/features/persistent-connections.xml:1.16 Wed Dec 12 15:46:34 2001 +++ phpdoc/en/features/persistent-connections.xml Tue Dec 18 15:49:03 2001 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.16 $ -- +!-- $Revision: 1.17 $ -- chapter id=features.persistent-connections titlePersistent Database Connections/title @@ -12,6 +12,12 @@ connection is a connection that was opened to the same host, with the same username and the same password (where applicable). /simpara + note + para +There are other extensions that provide persistent connections, such as +the link linkend=ref.imapIMAP extension/link. + /para + /note simpara People who aren't thoroughly familiar with the way web servers work and distribute the load may mistake persistent connects for what @@ -125,7 +131,16 @@ probably will) change the efficiency of the script, but not its behavior! /simpara - + para + See also functionfbsql_pconnect/function, + functionibase_pconnect/function, functionifx_pconnect/function, + functionimap_popen/function, functioningres_pconnect/function, + functionmsql_pconnect/function, functionmssql_pconnection/function, + functionmysql_pconnect/function, functionOCIPLogon/function, + functionodbc_pconnect/function, functionOra_pLogon/function, + functionpfsockopen/function, functionpg_pconnect/function, and + functionsybase_pconnect/function. + /para /chapter !-- Keep this comment at the end of the file
[PHP-DOC] cvs: phpdoc /pl/features persistent-connections.xml
leszek Mon Dec 17 23:10:12 2001 EDT Modified files: /phpdoc/pl/features persistent-connections.xml Log: Added comments for revcheck Index: phpdoc/pl/features/persistent-connections.xml diff -u phpdoc/pl/features/persistent-connections.xml:1.5 phpdoc/pl/features/persistent-connections.xml:1.6 --- phpdoc/pl/features/persistent-connections.xml:1.5 Sun Dec 16 22:59:32 2001 +++ phpdoc/pl/features/persistent-connections.xml Mon Dec 17 23:10:12 2001 @@ -1,5 +1,6 @@ ?xml version=1.0 encoding=iso-8859-2? -!-- $Revision: 1.5 $ -- +!-- EN-Revision: 1.14 Maintainer: slawek Status: ready -- +!-- $Revision: 1.6 $ -- chapter id=features.persistent-connections titleSta³e po³±czenia z bazami danych/title
[PHP-DOC] cvs: phpdoc /pl/features persistent-connections.xml
leszek Sun Dec 16 22:59:32 2001 EDT Modified files: /phpdoc/pl/features persistent-connections.xml Log: Update Index: phpdoc/pl/features/persistent-connections.xml diff -u phpdoc/pl/features/persistent-connections.xml:1.4 phpdoc/pl/features/persistent-connections.xml:1.5 --- phpdoc/pl/features/persistent-connections.xml:1.4 Wed Dec 12 15:56:09 2001 +++ phpdoc/pl/features/persistent-connections.xml Sun Dec 16 22:59:32 2001 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-2? -!-- $Revision: 1.4 $ -- +!-- $Revision: 1.5 $ -- chapter id=features.persistent-connections titleSta³e po³±czenia z bazami danych/title @@ -107,7 +107,6 @@ sgml-always-quote-attributes:t sgml-indent-step:1 sgml-indent-data:t -indent-tabs-mode:nil sgml-parent-document:nil sgml-default-dtd-file:../../manual.ced sgml-exposed-tags:nil
[PHP-DOC] cvs: phpdoc /ja/features persistent-connections.xml
fujimotoWed Dec 12 09:05:03 2001 EDT Modified files: /phpdoc/ja/features persistent-connections.xml Log: updated translation (up to 1.15). Index: phpdoc/ja/features/persistent-connections.xml diff -u phpdoc/ja/features/persistent-connections.xml:1.4 phpdoc/ja/features/persistent-connections.xml:1.5 --- phpdoc/ja/features/persistent-connections.xml:1.4 Wed Nov 14 17:55:19 2001 +++ phpdoc/ja/features/persistent-connections.xml Wed Dec 12 09:05:00 2001 @@ -78,6 +78,36 @@ 合、各子プロセス毎にSQLサーバーへの20の異なった接続が行われます。 /simpara simpara + +しかし、気をつけなければならないことが一つあります。それはデータ + +ベースへの接続数を制限して使用している場合に、持続的な子プロセスの + +接続数がその数を超えると問題が発生し得ることです。もしデータベース + +の同時接続数の制限が16だとして、サーバに多くのアクセスがあったため + +17個の子プロセスが接続しようとするとそのうちの一つは接続に失敗しま + +す。もしスクリプトにコネクションをシャットダウンしないようなバグ( + +例えば無限ループ)があると32程度の同時接続しか許容しないデータベース + +はすぐにダメになってしまいます。使用しているデータベースが、中断さ + +れた、もしくは使用されていないコネクションをどのように扱うかを確認 + してみてください。 + /simpara + warning + simpara + +持続的接続を使用する際にはまだいくつか心に留めておく必要がある注意 + +点があります。一つは持続的接続でテーブルをロックする場合にスクリプト + +が何らかの理由でロックを外し損ねると、それ以降に実行されるスクリプト + +がその接続を使用すると永久にブロックしつづけてしまい、ウェブサーバか + +データベースサーバを再起動しなければならなくなるということです。もう + +一つはトランザクションを使用している場合に、トランザクションブロック + +が終了する前にスクリプトが終了してしまうとそのトランザクションブロッ + +クもまた次に同じ接続を使用して実行されるスクリプトに引き継がれる、と + +いうことです。どちらの場合でもfunctionregister_shutdown_function + +/functionを使用してテーブルのロックを解除したりトランザクションを + +ロールバックする簡単なクリーンアップ関数を登録することができます。 + +しかしそれよりも良い方法は、テーブルロックやトランザクションを使用 + +するスクリプトでは持続的接続を使用せず、問題を完全に避けて通ることで + す(他の箇所で使用する分には問題ありません)。 + /simpara + /warning + simpara 重要なことをまとめます。持続的接続は、標準的な接続に1対1の割りつけ を行うように設計されています。このことは、emphasis常に/emphasis 持続的接続を非持続的接続で置きかえ、かつ動作を変更しないということ
[PHP-DOC] cvs: phpdoc /en/features persistent-connections.xml
torben Tue Nov 20 22:00:09 2001 EDT Modified files: /phpdoc/en/features persistent-connections.xml Log: Added a warning about using persistent connections and table locks/transactions together. The transaction note was from the user errata. Index: phpdoc/en/features/persistent-connections.xml diff -u phpdoc/en/features/persistent-connections.xml:1.14 phpdoc/en/features/persistent-connections.xml:1.15 --- phpdoc/en/features/persistent-connections.xml:1.14 Sat Nov 10 16:49:30 2001 +++ phpdoc/en/features/persistent-connections.xml Tue Nov 20 22:00:09 2001 @@ -1,5 +1,5 @@ ?xml version=1.0 encoding=iso-8859-1? -!-- $Revision: 1.14 $ -- +!-- $Revision: 1.15 $ -- chapter id=features.persistent-connections titlePersistent Database Connections/title @@ -98,6 +98,24 @@ may be rapidly swamped. Check your database documentation for information on handling abandoned or idle connections. /simpara + warning + simpara +There are a couple of additional caveats to keep in mind when +using persistent connections. One is that when using table +locking on a persistent connection, if the script for whatever +reason cannot release the lock, then subsequent scripts using the +same connection will block indefinitely and may require that you +either restart the httpd server or the database server. Another is +that when using transactions, a transaction block will also carry +over to the next script which uses that connection if script execution +ends before the transaction block does. In either case, you can +use functionregister_shutdown_function/function to register a +simple cleanup function to unlock your tables or roll back your +transactions. Better yet, avoid the problem entirely by not using +persistent connections in scripts which use table locks or +transactions (you can still use them elsewhere). + /simpara + /warning simpara An important summary. Persistent connections were designed to have one-to-one mapping to regular connections. That means that you
[PHP-DOC] cvs: phpdoc /pl/features persistent-connections.xml
slawek Fri Nov 2 18:29:28 2001 EDT Added files: /phpdoc/pl/features persistent-connections.xml Log: Finished translation Index: phpdoc/pl/features/persistent-connections.xml +++ phpdoc/pl/features/persistent-connections.xml ?xml encoding=iso-8859-1? !-- $Revision: 1.1 $ -- chapter id=features.persistent-connections titleSta³e po³±czenia z bazami danych/title simpara Sta³e po³±czenia (persistent connections) to po³±czenia, które nie s± zamykane po wykonaniu skryptu. Kiedy skrypt próbuje nawi±zaæ sta³e po³±czenie, PHP sprawdza czy istnieje ju¿ identyczne po³±czenie (otwarte wcze¶niej) i je¶li istnieje, u¿ywa go. Je¿eli nie, tworzone jest nowe. Po³±czenie 'identyczne' to po³±czenie z tym samym hostem, z tak± sam± nazw± u¿ytkownika i has³em. /simpara simpara Ludzie niezbyt dobrze znaj±cy zasady dzia³ania serwerów mog± czasem braæ sta³e po³±czenia za co¶, czym te nie s±. Sta³e po³±czenia emphasisnie/emphasis stwarzaj± mo¿liwo¶ci otwarcia po³±czenia dla konkretnego u¿ytkonika, emphasisnie/emphasis pozwalaj± na skuteczne stworzenie systemu transakcji, i nie robi± wielu innych rzeczy. Powiedzmy to jasno, sta³e po³±czenia nie oferuj± emphasisnic/emphasis ponad to, co robi± 'zwyk³e' po³±czenia. /simpara simpara Dlaczego? /simpara simpara Jest to zwi±zane z zasad± dzia³ania serwerów. S± trzy sposoby na które serwer mo¿e wykorzystac PHP do generowania stron. /simpara simpara Pierwsza metoda to wykorzystanie PHP jako wrappera CGI. Przy wywo³aniu skryptu ka¿dorazowo uruchamiany i niszczony jest egzamplarz PHP. Jako, ¿e jest on niszczony po ka¿dym wywo³aniu, wszystkie zasoby przez niego posiadane (na przyk³ad po³±czenia z baz± danych) s± tracone. W tym przypadku u¿ywanie sta³ych po³±czeñ nie przynosi korzy¶ci, one po prostu nie s± sta³e. /simpara simpara Druga, najpopularniejsza metoda, to uruchomienie PHP jako modu³u w wieloprocesowym serwerze, co obecnie dotyczy jedynie serwera Apache. Serwer wieloprocesowy zwykle uruchamia jeden proces (rodzica), który koordynuje inne procesy (potomne) zajmuj±ce siê dostarczaniem stron. Kiedy nadchodzi ¿±danie od klienta, jest ono przekazywane jednemu z procesów potomnych, który w danym momencie nie obs³uguje innego klienta. Oznacza to, ¿e gdy ten sam klient wy¶le do serwera kolejne ¿±danie, mo¿e zostaæ obs³u¿ony przez inny proces ni¿ za pierwszym razem. Sta³e po³±czenie w tym przypadku oznacza, ¿e ka¿dy proces potomny ustanawia po³±czenie z serwerem SQL przy pierwszym wywo³aniu strony, która takiego po³±czenia u¿ywa. Je¶li inna strona potrzebuje po³±czenia z serwerem SQL, mo¿e wykorzystaæ po³±czenie, które dany proces ustanowi³ wcze¶niej. /simpara simpara Ustatnia metoda to wykorzystanie PHP jako wtyczki (plug-in) do serwera wielow±tkowego. Obecnie PHP4 zawiera obs³ugê mechanizmów ISAPI, WSAPI i NSAPI (w Windows), które umo¿liwiaj± uruchomienie PHP jako wtyczki do wielow±tkowych serwerów takich jak Netscape FastTrack (iPlanet), Microsoft Internet Information Server (IIS) i O'Reilly WebSite Pro. Zachowanie PHP jest zasadniczo takie samo jak w przypadku opisanego wcze¶niej modelu wieloprocesowego. Mechanizmy SAPI nie s± obs³ugiwane przez PHP 3. /simpara simpara Skoro sta³e po³±czenia nie dostarczaj± wiêkszej funkcjonalno¶ci, do czego mog± byæ przydatne? /simpara simpara Odpowied¼ jest niezwykle prosta -- wydajno¶æ. Sta³e po³±czenia sprawdzaj± siê w przypadku, gdy koszt nawi±zania po³±czenia z SQL serwerem jest wysoki. To czy koszt jest du¿y czy nie zale¿y od wielu czynników. Na przyk³ad od typu bazy danych, od tego czy znajduje siê ona na tym samym serwerze, od obci±¿enia maszyny, która obs³uguje serwer SQL, itd. Je¶li zatem koszt po³±czenia jest wysoki, sta³e po³±czenia znacznie pomagaj±. Sprawiaj±, ¿e proces potomny ³±czy siê z serwerem SQL tylko raz podczas swojego ¿ycia, zamiast otwieraæ po³±czenie za ka¿dym razem gdy za¿±da tego skrypt. Oznacza to, ¿e ka¿dy proces potomny, który nawi±za³ sta³e po³±czenie, bêdzie posiada³ w³asne po³±czenie z serwerem bazy danych. Dla przyk³adu, je¿eli 20 procesów potomnych uruchomi skrypt, który ustanowi sta³e po³±czenie z serwerem SQL, bêdziesz mieæ 20 ró¿nych po³±czeñ z serwerem, jedno na ka¿dy proces. /simpara simpara Trzeba jednak zauwa¿yæ, ¿e mo¿e to mieæ swoje ujemne strony w przypadku gdy, limit po³±czeñ do bazy danych zostanie przekroczony przez sta³e po³±czenia z procesów potomnych. Je¶li twoja baza danych posiada limit szesnastu jednoczesnych po³±czeñ, a w danej chwili obci±¿enie jest wysokie, siedemnasty proces nie bêdzie móg³ siê po³±czyæ. Je¶li twoje skrypty zawieraj± b³êdy, które nie pozwalaj± zamkn±æ po³±czeñ (na przyk³±d nieskoñczone pêtle), baza danych z limitem 32 po³±czeñ mo¿e szybko zostaæ zapchana. Poszukaj w dokumentacji swojej bazy danych w jaki
[PHP-DOC] cvs: phpdoc /it/features persistent-connections.xml
cortesi Wed Jul 18 13:03:18 2001 EDT Modified files: /phpdoc/it/features persistent-connections.xml Log: initial translation Index: phpdoc/it/features/persistent-connections.xml diff -u /dev/null phpdoc/it/features/persistent-connections.xml:1.4 --- /dev/null Wed Jul 18 13:03:18 2001 +++ phpdoc/it/features/persistent-connections.xml Wed Jul 18 13:03:17 2001 @@ -0,0 +1,132 @@ + chapter id=features.persistent-connections + titleConnessioni Persistenti ai Database/title + + simpara + Connessioni persistenti sono collegamenti SQL che non vengono chiusi quando + l'esecusione di uno script viene terminata. Quando egrave; richiesta una +connessione + persistente, PHP controlla se esiste giagrave; una identica connessione +persistente + (che egrave; rimasta aperta da prima) - e se esiste, la + usa. Se non esiste, crea il collegamento. Una connessione 'identica' + egrave; una connessione aperta verso lo stesso host, con + lo stesso username e la stessa password (dove applicabile). + /simpara + simpara + Chi non ha molta familiaritagrave; con il modo in cui lavorano i server web + e di come essi distribuiscano il carico potrebbero confondere le connessioni +permanenti per ciograve; + che esse non sono. In particolare, emphasisnon/emphasis danno + la possibilitagrave; di aprire 'sessioni utente' sullo stesso collegamento SQL, + emphasisnon/emphasis danno la possibilitagrave; di gestire una transazione in + maniera efficiente e sopratutto non fanno molte altre + cose. Infatti, per essere molto chiari su questo punto, + le connessioni persistenti non hanno emphasisnessuna/emphasis + funzionaliagrave; che non era disponibile con le loro omonime + non-persistenti. + /simpara + simpara + Percheacute;? + /simpara + simpara + Questo ha a che fare con il modo in cui i server web operano. Ci sono tre modi + in cui un server web puograve; utilizzare PHP per generare le pagine web. + /simpara + simpara + Il primo metodo grave; quello di usare il PHP come un wrapper (involucro) CGI. +Quando viene + eseguito in questa modalitagrave;, per ogni pagina che viene richiesta al server +web + che contenga del codice PHP, viene creata e, alla fine dell'esecuzione, distrutta, + una istanza dell'interprete PHP. + Poicheacute; viene distrutta alla fine di ogni richiesta, qualunque risorsa + abbia acquisito (come ad esempio un collegamento ad un server di database SQL) +verragrave; + anch'essa distrutta. In questo caso, non vi egrave; nessun guadagno nell'usare + le connessioni persistenti -- semplicemente esse non persistono. + /simpara + simpara + Il secondo, e piugrave; popolare, metodo egrave; quello di eseguire il programma +PHP come modulo in un + server web multiprocesso, cosa che attualmente include solo Apache. Un + server multiprocesso ha tipicamente un processo (il padre) che + coordina un insieme di processi (i suoi figli) che sono quelli che + generano le pagine web. Quando arriva una richiesta da parte di un + client, questa egrave; passata ad uno dei figli che in quel momento + non egrave; giagrave; occupato a servire un altro client. Questo significa che +quando lo stesso client effettua + una seconda richiesta al server, esso potragrave; essere servito da un diverso +processo + figlio rispetto a quello della prima volta. In questa situazione, usare una + connessione persistente, permette di stabilire una e una sola connessione + al database SQL per ogni processo figlio, poicheacute; ciascun + processo figlio necessita di collegarsi al database SQL solo la + prima volta che richiama una pagina che ne fa uso. Quando viene richamata + un'altra pagina che necessita di una connessione al server SQL, essa puograve; + riutilizzare la connessione che lo stesso processo figlio aveva + stabilito in precedenza. + /simpara + simpara + L'ultimo metodo egrave; quello di usare il PHP come una plug-in per un server web + multithread. Attualmente PHP 4 supporta ISAPI, WSAPI e NSAPI (su piattaforma + Windows), i quali permettono di usare PHP come una plug-in sui server web +multithread + come FastTrack di Netscape, Internet Information Server (IIS) di Microsoft e + WebSite Pro di O'Reilly. Il comportamento egrave; essenzialmente + lo stesso che si ha nel modello multiprocesso descritto prima. Si noti che + il supporto SAPI non egrave; disponibile in PHP 3. + /simpara + simpara + Se le connessioni persistenti non hanno nessuna funzionalitagrave; aggiuntiva, +perchacute; + usarle? + /simpara + simpara + La risposta, in questo caso egrave; estremamente semplice: efficienza. Le +connessioni + persistenti sono utili se il carico di lavoro necessario per aprire una +connessione al server SQL + egrave; alto. Che il carico sia molto alto o meno dipende + da molti fattori. Quali, il tipo di database che si utilizza, il fatto che + esso si trovi sulla
[PHP-DOC] cvs: phpdoc /kr/features persistent-connections.xml
regina Thu Feb 8 01:48:02 2001 EDT Modified files: /phpdoc/kr/features persistent-connections.xml Log: PR: v1.7 in English version Submitted by: Reviewed by: Obtained from: Index: phpdoc/kr/features/persistent-connections.xml diff -u phpdoc/kr/features/persistent-connections.xml:1.4 phpdoc/kr/features/persistent-connections.xml:1.5 --- phpdoc/kr/features/persistent-connections.xml:1.4 Wed Jan 10 22:00:36 2001 +++ phpdoc/kr/features/persistent-connections.xml Thu Feb 8 01:48:02 2001 @@ -46,12 +46,11 @@ /simpara simpara 마지막 방법은 PHP를 멀티쓰레드(multithreaded) 웹서버의 플러그-인의 - 형태로 작동시키는 것인데, 현재 이방법은 이론적으로만 존재하고, - 실제로 만들어 진 것은 없다. ISAPI, WSAPI, NSAPI (Windows에서) 등의 + 형태로 작동시키는 것이다. 현재 PHP4는 windows 환경에서 ISAPI +혹은 WSAPI, NSAPI의 방법을 방법을 사용하여 Netscape FastTrack, Microsoft's Internet Information Server (IIS), - O'Reilly's WebSite Pro 등의 멀티쓰레드 웹서버에서 PHP를 플러그-인으로 - 동작시키려는 작업이 현재 진행중이다. 이 경우 기본 동작은 위에서 언급한 - 다중프로세스 모델과 동일하게 동작한다. + O'Reilly's WebSite Pro 등의 멀티쓰레드 웹서버에서 +플러그-인으로 동작한다. + 이 경우 기본 동작은 위에서 언급한 다중프로세스 모델과 +동일하게 동작한다. + 단, PHP3는 이와 같은 SAPI 형태를 지원하지 않는다. /simpara simpara 영구적인 접속이 실제로 어떠한 기능적인 향상도 주지 못한다면,
[PHP-DOC] cvs: phpdoc /en/features persistent-connections.xml
gobaFri Jan 26 07:20:21 2001 EDT Modified files: /phpdoc/en/features persistent-connections.xml Log: Correct the xSAPI notes, cause xSAPI works now :) Index: phpdoc/en/features/persistent-connections.xml diff -u phpdoc/en/features/persistent-connections.xml:1.5 phpdoc/en/features/persistent-connections.xml:1.6 --- phpdoc/en/features/persistent-connections.xml:1.5 Fri Dec 22 09:52:05 2000 +++ phpdoc/en/features/persistent-connections.xml Fri Jan 26 07:20:21 2001 @@ -56,14 +56,12 @@ /simpara simpara The last method is to use PHP as a plug-in for a multithreaded web - server. Currently this is only theoretical -- PHP does not yet work - as a plug-in for any multithreaded web servers. Work is progressing - on support for ISAPI, WSAPI, and NSAPI (on Windows), which will all - allow PHP to be used as a plug-in on multithreaded servers like - Netscape FastTrack, Microsoft's Internet Information Server (IIS), - and O'Reilly's WebSite Pro. When this happens, the behavior will be - essentially the same as for the multiprocess model described - before. + server. Currently PHP 4 has support for ISAPI, WSAPI, and NSAPI (on + Windows), which all allow PHP to be used as a plug-in on multithreaded + servers like Netscape FastTrack, Microsoft's Internet Information + Server (IIS), and O'Reilly's WebSite Pro. The behavior is essentially + the same as for the multiprocess model described before. Note that +SAPI support is not available in PHP 3. /simpara simpara If persistent connections don't have any added functionality, what
[PHP-DOC] cvs: phpdoc /en/features persistent-connections.xml
gobaFri Jan 26 07:21:48 2001 EDT Modified files: /phpdoc/en/features persistent-connections.xml Log: Oh those tabs... Index: phpdoc/en/features/persistent-connections.xml diff -u phpdoc/en/features/persistent-connections.xml:1.6 phpdoc/en/features/persistent-connections.xml:1.7 --- phpdoc/en/features/persistent-connections.xml:1.6 Fri Jan 26 07:20:21 2001 +++ phpdoc/en/features/persistent-connections.xml Fri Jan 26 07:21:48 2001 @@ -61,7 +61,7 @@ servers like Netscape FastTrack, Microsoft's Internet Information Server (IIS), and O'Reilly's WebSite Pro. The behavior is essentially the same as for the multiprocess model described before. Note that -SAPI support is not available in PHP 3. + SAPI support is not available in PHP 3. /simpara simpara If persistent connections don't have any added functionality, what