This file is indexed.

/usr/share/doc/python-eventlet/html/modules/db_pool.html is in python-eventlet 0.9.16-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>db_pool – DBAPI 2 database connection pooling &mdash; Eventlet 0.9.16 documentation</title>
    
    <link rel="stylesheet" href="../_static/default.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '0.9.16',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/underscore.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="Eventlet 0.9.16 documentation" href="../index.html" />
    <link rel="up" title="Module Reference" href="../modules.html" />
    <link rel="next" title="event – Cross-greenthread primitive" href="event.html" />
    <link rel="prev" title="debug – Debugging tools for Eventlet" href="debug.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="event.html" title="event – Cross-greenthread primitive"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="debug.html" title="debug – Debugging tools for Eventlet"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">Eventlet 0.9.16 documentation</a> &raquo;</li>
          <li><a href="../modules.html" accesskey="U">Module Reference</a> &raquo;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="db-pool-dbapi-2-database-connection-pooling">
<h1><tt class="xref py py-mod docutils literal"><span class="pre">db_pool</span></tt> &#8211; DBAPI 2 database connection pooling<a class="headerlink" href="#db-pool-dbapi-2-database-connection-pooling" title="Permalink to this headline"></a></h1>
<p>The db_pool module is useful for managing database connections.  It provides three primary benefits: cooperative yielding during database operations, concurrency limiting to a database host, and connection reuse.  db_pool is intended to be database-agnostic, compatible with any DB-API 2.0 database module.</p>
<p><em>It has currently been tested and used with both MySQLdb and psycopg2.</em></p>
<p>A ConnectionPool object represents a pool of connections open to a particular database.  The arguments to the constructor include the database-software-specific module, the host name, and the credentials required for authentication.  After construction, the ConnectionPool object decides when to create and sever connections with the target database.</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">MySQLdb</span>
<span class="gp">&gt;&gt;&gt; </span><span class="n">cp</span> <span class="o">=</span> <span class="n">ConnectionPool</span><span class="p">(</span><span class="n">MySQLdb</span><span class="p">,</span> <span class="n">host</span><span class="o">=</span><span class="s">&#39;localhost&#39;</span><span class="p">,</span> <span class="n">user</span><span class="o">=</span><span class="s">&#39;root&#39;</span><span class="p">,</span> <span class="n">passwd</span><span class="o">=</span><span class="s">&#39;&#39;</span><span class="p">)</span>
</pre></div>
</div>
<p>Once you have this pool object, you connect to the database by calling <tt class="xref py py-meth docutils literal"><span class="pre">get()</span></tt> on it:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">conn</span> <span class="o">=</span> <span class="n">cp</span><span class="o">.</span><span class="n">get</span><span class="p">()</span>
</pre></div>
</div>
<p>This call may either create a new connection, or reuse an existing open connection, depending on whether it has one open already or not.  You can then use the connection object as normal.  When done, you must return the connection to the pool:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">conn</span> <span class="o">=</span> <span class="n">cp</span><span class="o">.</span><span class="n">get</span><span class="p">()</span>
<span class="gp">&gt;&gt;&gt; </span><span class="k">try</span><span class="p">:</span>
<span class="gp">... </span>    <span class="n">result</span> <span class="o">=</span> <span class="n">conn</span><span class="o">.</span><span class="n">cursor</span><span class="p">()</span><span class="o">.</span><span class="n">execute</span><span class="p">(</span><span class="s">&#39;SELECT NOW()&#39;</span><span class="p">)</span>
<span class="gp">... </span><span class="k">finally</span><span class="p">:</span>
<span class="gp">... </span>    <span class="n">cp</span><span class="o">.</span><span class="n">put</span><span class="p">(</span><span class="n">conn</span><span class="p">)</span>
</pre></div>
</div>
<p>After you&#8217;ve returned a connection object to the pool, it becomes useless and will raise exceptions if any of its methods are called.</p>
<div class="section" id="constructor-arguments">
<h2>Constructor Arguments<a class="headerlink" href="#constructor-arguments" title="Permalink to this headline"></a></h2>
<p>In addition to the database credentials, there are a bunch of keyword constructor arguments to the ConnectionPool that are useful.</p>
<ul class="simple">
<li>min_size, max_size : The normal Pool arguments.  max_size is the most important constructor argument &#8211; it determines the number of concurrent connections can be open to the destination database.  min_size is not very useful.</li>
<li>max_idle : Connections are only allowed to remain unused in the pool for a limited amount of time.  An asynchronous timer periodically wakes up and closes any connections in the pool that have been idle for longer than they are supposed to be.  Without this parameter, the pool would tend to have a &#8216;high-water mark&#8217;, where the number of connections open at a given time corresponds to the peak historical demand.  This number only has effect on the connections in the pool itself &#8211; if you take a connection out of the pool, you can hold on to it for as long as you want.  If this is set to 0, every connection is closed upon its return to the pool.</li>
<li>max_age : The lifespan of a connection.  This works much like max_idle, but the timer is measured from the connection&#8217;s creation time, and is tracked throughout the connection&#8217;s life.  This means that if you take a connection out of the pool and hold on to it for some lengthy operation that exceeds max_age, upon putting the connection back in to the pool, it will be closed.  Like max_idle, max_age will not close connections that are taken out of the pool, and, if set to 0, will cause every connection to be closed when put back in the pool.</li>
<li>connect_timeout : How long to wait before raising an exception on connect().  If the database module&#8217;s connect() method takes too long, it raises a ConnectTimeout exception from the get() method on the pool.</li>
</ul>
</div>
<div class="section" id="databaseconnector">
<h2>DatabaseConnector<a class="headerlink" href="#databaseconnector" title="Permalink to this headline"></a></h2>
<p>If you want to connect to multiple databases easily (and who doesn&#8217;t), the DatabaseConnector is for you.  It&#8217;s a pool of pools, containing a ConnectionPool for every host you connect to.</p>
<p>The constructor arguments are:</p>
<ul class="simple">
<li>module : database module, e.g. MySQLdb.  This is simply passed through to the ConnectionPool.</li>
<li>credentials : A dictionary, or dictionary-alike, mapping hostname to connection-argument-dictionary.  This is used for the constructors of the ConnectionPool objects.  Example:</li>
</ul>
<div class="highlight-python"><div class="highlight"><pre><span class="gp">&gt;&gt;&gt; </span><span class="n">dc</span> <span class="o">=</span> <span class="n">DatabaseConnector</span><span class="p">(</span><span class="n">MySQLdb</span><span class="p">,</span>
<span class="gp">... </span>     <span class="p">{</span><span class="s">&#39;db.internal.example.com&#39;</span><span class="p">:</span> <span class="p">{</span><span class="s">&#39;user&#39;</span><span class="p">:</span> <span class="s">&#39;internal&#39;</span><span class="p">,</span> <span class="s">&#39;passwd&#39;</span><span class="p">:</span> <span class="s">&#39;s33kr1t&#39;</span><span class="p">},</span>
<span class="gp">... </span>      <span class="s">&#39;localhost&#39;</span><span class="p">:</span> <span class="p">{</span><span class="s">&#39;user&#39;</span><span class="p">:</span> <span class="s">&#39;root&#39;</span><span class="p">,</span> <span class="s">&#39;passwd&#39;</span><span class="p">:</span> <span class="s">&#39;&#39;</span><span class="p">}})</span>
</pre></div>
</div>
<p>If the credentials contain a host named &#8216;default&#8217;, then the value for &#8216;default&#8217; is used whenever trying to connect to a host that has no explicit entry in the database.  This is useful if there is some pool of hosts that share arguments.</p>
<ul class="simple">
<li>conn_pool : The connection pool class to use.  Defaults to db_pool.ConnectionPool.</li>
</ul>
<p>The rest of the arguments to the DatabaseConnector constructor are passed on to the ConnectionPool.</p>
<p><em>Caveat: The DatabaseConnector is a bit unfinished, it only suits a subset of use cases.</em></p>
<span class="target" id="module-eventlet.db_pool"></span><dl class="class">
<dt id="eventlet.db_pool.BaseConnectionPool">
<em class="property">class </em><tt class="descclassname">eventlet.db_pool.</tt><tt class="descname">BaseConnectionPool</tt><big>(</big><em>db_module</em>, <em>min_size=0</em>, <em>max_size=4</em>, <em>max_idle=10</em>, <em>max_age=30</em>, <em>connect_timeout=5</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.BaseConnectionPool" title="Permalink to this definition"></a></dt>
<dd><dl class="method">
<dt id="eventlet.db_pool.BaseConnectionPool.clear">
<tt class="descname">clear</tt><big>(</big><big>)</big><a class="headerlink" href="#eventlet.db_pool.BaseConnectionPool.clear" title="Permalink to this definition"></a></dt>
<dd><p>Close all connections that this pool still holds a reference to,
and removes all references to them.</p>
</dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.BaseConnectionPool.get">
<tt class="descname">get</tt><big>(</big><big>)</big><a class="headerlink" href="#eventlet.db_pool.BaseConnectionPool.get" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.BaseConnectionPool.put">
<tt class="descname">put</tt><big>(</big><em>conn</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.BaseConnectionPool.put" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="exception">
<dt id="eventlet.db_pool.ConnectTimeout">
<em class="property">exception </em><tt class="descclassname">eventlet.db_pool.</tt><tt class="descname">ConnectTimeout</tt><a class="headerlink" href="#eventlet.db_pool.ConnectTimeout" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="attribute">
<dt id="eventlet.db_pool.ConnectionPool">
<tt class="descclassname">eventlet.db_pool.</tt><tt class="descname">ConnectionPool</tt><a class="headerlink" href="#eventlet.db_pool.ConnectionPool" title="Permalink to this definition"></a></dt>
<dd><p>alias of <a class="reference internal" href="#eventlet.db_pool.TpooledConnectionPool" title="eventlet.db_pool.TpooledConnectionPool"><tt class="xref py py-class docutils literal"><span class="pre">TpooledConnectionPool</span></tt></a></p>
</dd></dl>

<dl class="class">
<dt id="eventlet.db_pool.DatabaseConnector">
<em class="property">class </em><tt class="descclassname">eventlet.db_pool.</tt><tt class="descname">DatabaseConnector</tt><big>(</big><em>module</em>, <em>credentials</em>, <em>conn_pool=None</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.DatabaseConnector" title="Permalink to this definition"></a></dt>
<dd><p>This is an object which will maintain a collection of database
connection pools on a per-host basis.</p>
<dl class="method">
<dt id="eventlet.db_pool.DatabaseConnector.credentials_for">
<tt class="descname">credentials_for</tt><big>(</big><em>host</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.DatabaseConnector.credentials_for" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.DatabaseConnector.get">
<tt class="descname">get</tt><big>(</big><em>host</em>, <em>dbname</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.DatabaseConnector.get" title="Permalink to this definition"></a></dt>
<dd><p>Returns a ConnectionPool to the target host and schema.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="eventlet.db_pool.GenericConnectionWrapper">
<em class="property">class </em><tt class="descclassname">eventlet.db_pool.</tt><tt class="descname">GenericConnectionWrapper</tt><big>(</big><em>baseconn</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper" title="Permalink to this definition"></a></dt>
<dd><dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.affected_rows">
<tt class="descname">affected_rows</tt><big>(</big><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.affected_rows" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.autocommit">
<tt class="descname">autocommit</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.autocommit" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.begin">
<tt class="descname">begin</tt><big>(</big><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.begin" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.change_user">
<tt class="descname">change_user</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.change_user" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.character_set_name">
<tt class="descname">character_set_name</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.character_set_name" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.close">
<tt class="descname">close</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.close" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.commit">
<tt class="descname">commit</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.commit" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.cursor">
<tt class="descname">cursor</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.cursor" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.dump_debug_info">
<tt class="descname">dump_debug_info</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.dump_debug_info" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.errno">
<tt class="descname">errno</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.errno" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.error">
<tt class="descname">error</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.error" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.errorhandler">
<tt class="descname">errorhandler</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.errorhandler" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.literal">
<tt class="descname">literal</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.literal" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.ping">
<tt class="descname">ping</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.ping" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.query">
<tt class="descname">query</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.query" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.rollback">
<tt class="descname">rollback</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.rollback" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.select_db">
<tt class="descname">select_db</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.select_db" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.server_capabilities">
<tt class="descname">server_capabilities</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.server_capabilities" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.set_character_set">
<tt class="descname">set_character_set</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.set_character_set" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.set_server_option">
<tt class="descname">set_server_option</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.set_server_option" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.set_sql_mode">
<tt class="descname">set_sql_mode</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.set_sql_mode" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.show_warnings">
<tt class="descname">show_warnings</tt><big>(</big><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.show_warnings" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.shutdown">
<tt class="descname">shutdown</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.shutdown" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.sqlstate">
<tt class="descname">sqlstate</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.sqlstate" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.stat">
<tt class="descname">stat</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.stat" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.store_result">
<tt class="descname">store_result</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.store_result" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.string_literal">
<tt class="descname">string_literal</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.string_literal" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.thread_id">
<tt class="descname">thread_id</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.thread_id" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.use_result">
<tt class="descname">use_result</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.use_result" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.GenericConnectionWrapper.warning_count">
<tt class="descname">warning_count</tt><big>(</big><big>)</big><a class="headerlink" href="#eventlet.db_pool.GenericConnectionWrapper.warning_count" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="eventlet.db_pool.PooledConnectionWrapper">
<em class="property">class </em><tt class="descclassname">eventlet.db_pool.</tt><tt class="descname">PooledConnectionWrapper</tt><big>(</big><em>baseconn</em>, <em>pool</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.PooledConnectionWrapper" title="Permalink to this definition"></a></dt>
<dd><p>A connection wrapper where:
- the close method returns the connection to the pool instead of closing it directly
- <tt class="docutils literal"><span class="pre">bool(conn)</span></tt> returns a reasonable value
- returns itself to the pool if it gets garbage collected</p>
<dl class="method">
<dt id="eventlet.db_pool.PooledConnectionWrapper.close">
<tt class="descname">close</tt><big>(</big><big>)</big><a class="headerlink" href="#eventlet.db_pool.PooledConnectionWrapper.close" title="Permalink to this definition"></a></dt>
<dd><p>Return the connection to the pool, and remove the
reference to it so that you can&#8217;t use it again through this
wrapper object.</p>
</dd></dl>

</dd></dl>

<dl class="class">
<dt id="eventlet.db_pool.RawConnectionPool">
<em class="property">class </em><tt class="descclassname">eventlet.db_pool.</tt><tt class="descname">RawConnectionPool</tt><big>(</big><em>db_module</em>, <em>min_size=0</em>, <em>max_size=4</em>, <em>max_idle=10</em>, <em>max_age=30</em>, <em>connect_timeout=5</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.RawConnectionPool" title="Permalink to this definition"></a></dt>
<dd><p>A pool which gives out plain database connections.</p>
<dl class="classmethod">
<dt id="eventlet.db_pool.RawConnectionPool.connect">
<em class="property">classmethod </em><tt class="descname">connect</tt><big>(</big><em>db_module</em>, <em>connect_timeout</em>, <em>*args</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.RawConnectionPool.connect" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.RawConnectionPool.create">
<tt class="descname">create</tt><big>(</big><big>)</big><a class="headerlink" href="#eventlet.db_pool.RawConnectionPool.create" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

<dl class="class">
<dt id="eventlet.db_pool.TpooledConnectionPool">
<em class="property">class </em><tt class="descclassname">eventlet.db_pool.</tt><tt class="descname">TpooledConnectionPool</tt><big>(</big><em>db_module</em>, <em>min_size=0</em>, <em>max_size=4</em>, <em>max_idle=10</em>, <em>max_age=30</em>, <em>connect_timeout=5</em>, <em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.TpooledConnectionPool" title="Permalink to this definition"></a></dt>
<dd><p>A pool which gives out <a class="reference internal" href="../threading.html#eventlet.tpool.Proxy" title="eventlet.tpool.Proxy"><tt class="xref py py-class docutils literal"><span class="pre">Proxy</span></tt></a>-based database
connections.</p>
<dl class="classmethod">
<dt id="eventlet.db_pool.TpooledConnectionPool.connect">
<em class="property">classmethod </em><tt class="descname">connect</tt><big>(</big><em>db_module</em>, <em>connect_timeout</em>, <em>*args</em>, <em>**kw</em><big>)</big><a class="headerlink" href="#eventlet.db_pool.TpooledConnectionPool.connect" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

<dl class="method">
<dt id="eventlet.db_pool.TpooledConnectionPool.create">
<tt class="descname">create</tt><big>(</big><big>)</big><a class="headerlink" href="#eventlet.db_pool.TpooledConnectionPool.create" title="Permalink to this definition"></a></dt>
<dd></dd></dl>

</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
  <h3><a href="../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#"><tt class="docutils literal"><span class="pre">db_pool</span></tt> &#8211; DBAPI 2 database connection pooling</a><ul>
<li><a class="reference internal" href="#constructor-arguments">Constructor Arguments</a></li>
<li><a class="reference internal" href="#databaseconnector">DatabaseConnector</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="debug.html"
                        title="previous chapter"><tt class="docutils literal docutils literal"><span class="pre">debug</span></tt> &#8211; Debugging tools for Eventlet</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="event.html"
                        title="next chapter"><tt class="docutils literal"><span class="pre">event</span></tt> &#8211; Cross-greenthread primitive</a></p>
  <h3>This Page</h3>
  <ul class="this-page-menu">
    <li><a href="../_sources/modules/db_pool.txt"
           rel="nofollow">Show Source</a></li>
  </ul>
<div id="searchbox" style="display: none">
  <h3>Quick search</h3>
    <form class="search" action="../search.html" method="get">
      <input type="text" name="q" />
      <input type="submit" value="Go" />
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
    <p class="searchtip" style="font-size: 90%">
    Enter search terms or a module, class or function name.
    </p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../py-modindex.html" title="Python Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="event.html" title="event – Cross-greenthread primitive"
             >next</a> |</li>
        <li class="right" >
          <a href="debug.html" title="debug – Debugging tools for Eventlet"
             >previous</a> |</li>
        <li><a href="../index.html">Eventlet 0.9.16 documentation</a> &raquo;</li>
          <li><a href="../modules.html" >Module Reference</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
        &copy; Copyright 2005-2010, Eventlet Contributors.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1.3.
    </div>
  </body>
</html>