You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<trclass="field"><thclass="docinfo-name">Translations:</th><tdclass="field-body"><aclass="reference" href="UsersGuide.html">English</a> German <aclass="reference" href="UsersGuide.zh.html">Chinese</a></td>
<li><pclass="first"><ttclass="docutils literal"><spanclass="pre">closeable</span></tt>: wenn dies auf <ttclass="docutils literal"><spanclass="pre">True</span></tt> gesetzt wird, dann wird das Schließen
317
317
von Verbindungen erlaubt, normalerweise wird es jedoch ignoriert</p>
318
318
</li>
319
+
<li><pclass="first"><ttclass="docutils literal"><spanclass="pre">threadlocal</span></tt>: eine optionale Klasse zur Speicherung thread-lokaler Daten,
320
+
die anstelle unserer Python-Implementierung benutzt wird (threading.local
321
+
ist schneller, kann aber nicht in allen Fällen verwendet werden)</p>
322
+
</li>
319
323
<li><pclass="first">Die als <ttclass="docutils literal"><spanclass="pre">creator</span></tt> angegebene Funktion oder die Funktion <ttclass="docutils literal"><spanclass="pre">connect</span></tt>
320
324
des DB-API-2-Datenbankadapter-Moduls erhalten alle weiteren Parameter,
321
325
wie <ttclass="docutils literal"><spanclass="pre">host</span></tt>, <ttclass="docutils literal"><spanclass="pre">database</span></tt>, <ttclass="docutils literal"><spanclass="pre">user</span></tt>, <ttclass="docutils literal"><spanclass="pre">password</span></tt> usw. Sie können einige
<p>Beachten Sie, dass das Holen einer Verbindung etwas beschleunigt werden kann,
353
+
indem Sie den Parameter <ttclass="docutils literal"><spanclass="pre">threadlocal</span></tt> auf <ttclass="docutils literal"><spanclass="pre">threading.local</span></tt> setzen; dies
354
+
könnte aber in einigen Umgebungen nicht funktionieren (es ist zum Beispiel
355
+
bekannt, dass <ttclass="docutils literal"><spanclass="pre">mod_wsgi</span></tt> hier Probleme bereitet, da es Daten, die mit <ttclass="docutils literal"><spanclass="pre">threading.local</span></tt> gespeichert wurden, zwischen Requests löscht).</p>
contrary to the intent of having persistent connections. Instead,
324
328
the connection will be automatically closed when the thread dies.
325
329
You can change this behavior be setting the <ttclass="docutils literal"><spanclass="pre">closeable</span></tt> parameter.</p>
330
+
<p>Note that by setting the <ttclass="docutils literal"><spanclass="pre">threadlocal</span></tt> parameter to <ttclass="docutils literal"><spanclass="pre">threading.local</span></tt>,
331
+
getting connections may become a bit faster, but this may not work in
332
+
all environments (for instance, <ttclass="docutils literal"><spanclass="pre">mod_wsgi</span></tt> is known to cause problems
333
+
here since it clears the <ttclass="docutils literal"><spanclass="pre">threading.local</span></tt> data between requests).</p>
0 commit comments