Ñò Š„[Jc @spdZddkZddkZddkZddklZlZddklZddk lZl Z l Z hZ d„Z d„Zdefd „ƒYZd efd „ƒYZdd „Zd efd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdefd„ƒYZdS(s{Connection pooling for DB-API connections. Provides a number of connection pool implementations for a variety of usage scenarios and thread behavior requirements imposed by the application, DB-API or database itself. Also provides a DB-API 2.0 connection proxying mechanism allowing regular DB-API connect() methods to be transparently managed by a SQLAlchemy connection pool. iÿÿÿÿN(texctlog(tqueue(t threadingtpicklet as_interfacecKs<y t|SWn)tj oti|t||ƒSXdS(sDReturn a proxy for a DB-API module that automatically pools connections. Given a DB-API 2.0 module and pool management parameters, returns a proxy for the module that will automatically pool connections, creating new connection pools for each distinct set of connection arguments sent to the decorated module's connect() function. :param module: a DB-API 2.0 database module :param poolclass: the class used by the pool module to provide pooling. Defaults to :class:`QueuePool`. :param \*\*params: will be passed through to *poolclass* N(tproxiestKeyErrort setdefaultt_DBProxy(tmoduletparams((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytmanages cCs/xtiƒD]}|iƒq WtiƒdS(sYRemove all current DB-API 2.0 managers. All pools and connections are disposed. N(Rtvaluestclosetclear(tmanager((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytclear_managers0s tPoolcBs’eZdZddeedd„Zd„Zd„Zd„Z d„Z d„Z d„Z d „Z d „Zd „Zd „Zd „Zd„ZRS(s)Abstract base class for connection pools.iÿÿÿÿcCs¥ti|d|ƒ|_tiƒ|_||_||_||_||_ ||_ g|_ g|_ g|_ g|_|o"x|D]}|i|ƒq†WndS(s Construct a Pool. :param creator: a callable function that returns a DB-API connection object. The function will be called with parameters. :param recycle: If set to non -1, number of seconds between connection recycling, which means upon checkout, if this timeout is surpassed the connection will be closed and replaced with a newly opened connection. Defaults to -1. :param echo: If True, connections being pulled and retrieved from the pool will be logged to the standard output, as well as pool sizing information. Echoing can also be achieved by enabling logging for the "sqlalchemy.pool" namespace. Defaults to False. :param use_threadlocal: If set to True, repeated calls to :meth:`connect` within the same application thread will be guaranteed to return the same connection object, if one has already been retrieved from the pool and has not been returned yet. Offers a slight performance advantage at the cost of individual transactions by default. The :meth:`unique_connection` method is provided to bypass the threadlocal behavior installed into :meth:`connect`. :param reset_on_return: If true, reset the database state of connections returned to the pool. This is typically a ROLLBACK to release locks and transaction resources. Disable at your own peril. Defaults to True. :param listeners: A list of :class:`~sqlalchemy.interfaces.PoolListener`-like objects or dictionaries of callables that receive events when DB-API connections are created, checked out and checked in to the pool. techoflagN(Rtinstance_loggertloggerRtlocalt _threadconnst_creatort_recyclet_use_threadlocalt_reset_on_returntechot listenerst _on_connectt _on_checkoutt _on_checkint add_listener(tselftcreatortrecycleRtuse_threadlocaltreset_on_returnRtl((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyt__init__=s)         cCst|ƒiƒS(N(t_ConnectionFairytcheckout(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytunique_connectionvscCs t|ƒS(N(t_ConnectionRecord(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytcreate_connectionyscCs tƒ‚dS(s8Return a new instance with identical creation arguments.N(tNotImplementedError(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytrecreate|scCs tƒ‚dS(sDispose of this pool. This method leaves the possibility of checked-out connections remaining open, It is advised to not reuse the pool once dispose() is called, and to instead use a new pool constructed by the recreate() method. N(R.(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytdisposes cCs|ipt|ƒiƒSy%|iiƒ}|o |iƒSWntj onXt|ƒ}ti|ƒ|i_|iƒS(N(RR)R*RtcurrenttAttributeErrortweakreftref(R"trectagent((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytconnectŒs  cCs;|io t|idƒo |i`n|i|ƒdS(NR1(RthasattrRR1tdo_return_conn(R"trecord((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyt return_conn›s cCs |iƒS(N(tdo_get(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytget scCs tƒ‚dS(N(R.(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR<£scCs tƒ‚dS(N(R.(R"tconn((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR9¦scCs tƒ‚dS(N(R.(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytstatus©scCs’t|ddƒ}|ii|ƒt|dƒo|ii|ƒnt|dƒo|ii|ƒnt|dƒo|ii|ƒndS(s Add a ``PoolListener``-like object to this pool. ``listener`` may be an object that implements some or all of PoolListener, or a dictionary of callables containing implementations of some or all of the named methods in PoolListener. tmethodsR7R*tcheckinN(sconnectscheckoutscheckin(RRtappendR8RRR (R"tlistener((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR!¬s cCs|ii|ƒdS(N(Rtinfo(R"tmsg((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRÀsN(t__name__t __module__t__doc__tNonetFalsetTrueR(R+R-R/R0R7R;R=R<R9R?R!R(((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR:s 8          R,cBsAeZd„Zd„Zdd„Zd„Zd„Zd„ZRS(cCsZ||_|iƒ|_h|_|io+x(|iD]}|i|i|ƒq5WndS(N(t_ConnectionRecord__poolt_ConnectionRecord__connectt connectionRDRR7(R"tpoolR'((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR(Äs    cCsž|idj oŠ|iio|iid|iƒny|iiƒWqšttfj o ‚qš|iio|iid|iƒq–qšXndS(NsClosing connection %rsException closing connection %r(RNRIRLt_should_log_infoRRt SystemExittKeyboardInterrupt(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRÌs   cCsv|iioR|dj o*|iid|i|ii|fƒq_|iid|iƒn|iƒd|_dS(Ns(Invalidate connection %r (reason: %s:%s)sInvalidate connection %r(RLRPRIRRNt __class__RFt_ConnectionRecord__close(R"te((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyt invalidateÙs    cCs2|idjo[|iƒ|_|iiƒ|iio.x+|iiD]}|i|i|ƒqFWq+nÁ|iidjo­t i ƒ|i |iijo|ii o|ii d|iƒn|i ƒ|iƒ|_|iiƒ|iio.x+|iiD]}|i|i|ƒqWq+n|iS(Niÿÿÿÿs)Connection %r exceeded timeout; recycling(RNRIRMRDRRLRR7Rttimet starttimeRPRRT(R"R'((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytget_connectionãs&   3      cCs y9|iio|iid|iƒn|iiƒWn`tj oT}|iio!|iid|i|fƒnt|ttfƒo‚qœnXdS(NsClosing connection %rs)Connection %r threw an error on close: %s( RLRPRRNRt Exceptiont isinstanceRQRR(R"RU((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyt__closeös   cCsyKtiƒ|_|iiƒ}|iio|iid|ƒn|SWn=tj o1}|iio|iid|ƒn‚nXdS(NsCreated new connection %rsError on connect(): %s(RWRXRLRRPRRZ(R"RNRU((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyt __connects  N( RFRGR(RRIRVRYRTRM(((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR,Ãs    cCs<|dj o|i|j odS|dj o‘y7|io|iƒn|djo|iƒnWqÀtj oG}|dj o|id|ƒnt|tt fƒo‚q¼qÀXn|dj okd|_|i o|i d|ƒn|i o(x%|i D]}|i ||ƒq Wn|i|ƒndS(NRUs$Connection %r being returned to pool(RItbackrefRtrollbackRRZRVR[RQRRRPRR RAR;(RNtconnection_recordROR4RUR'((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyt_finalize_fairys,         R)cBsŒeZdZdZd„Zed„ƒZed „ƒZed „ƒZdd „Z d „Z d „Z d„Z d„Zd„Zd„ZRS(sGProxies a DB-API connection and provides return-on-dereference support.t_poolt __counterRNt_connection_recordt __weakref__t_detached_infocs±ˆ|_d|_yTˆiƒ‰|_|iiƒ‰|_ti|‡‡‡fd†ƒ|i_Wnd|_d|_‚nX|ii o|ii d|iƒndS(Nicstˆˆˆ|ƒS((Ra(R4(R5ROR>(s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyt2ss#Connection %r checked out from pool( Rbt_ConnectionFairy__counterR=RdRYRNR3R4R^RIRPR(R"RO((ROR5R>s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR(,s  +    cCs |iiS(N(RbR(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyt_logger;scCs |idj S(N(RNRI(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytis_valid?scCszy|iiSWnetj oY|idjotidƒ‚ny |iSWqvtj oh|_}|SXnXdS(s4An info collection unique to this DB-API connection.sThis connection is closedN(RdRDR2RNRIRtInvalidRequestErrorRf(R"tvalue((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRDCs  cCsa|idjotidƒ‚n|idj o|iid|ƒnd|_|iƒdS(s·Mark this connection as invalidated. The connection will be immediately closed. The containing ConnectionRecord will create a new connection when next used. sThis connection is closedRUN(RNRIRRkRdRVt_close(R"RU((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRVRs  cOsUy&|ii||Ž}t||ƒSWn(tj o}|id|ƒ‚nXdS(NRU(RNtcursort _CursorFairyRZRV(R"targstkwargstcRU((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRn`s cCst|i|ƒS(N(tgetattrRN(R"tkey((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyt __getattr__hscCsR|idjotidƒ‚n|id7_|ii p|idjo|Sd}x¶|djo¨y8x-|iiD]}|i|i|i|ƒq{W|SWq^ti j oZ}|ii o|ii d|ƒn|ii |ƒ|ii ƒ|_|d8}q^Xq^W|ii o|ii dƒn|i ƒtidƒ‚dS(NsThis connection is closediiis&Disconnection detected on checkout: %ss+Reconnection attempts exhausted on checkout(RNRIRRkRhRbRR*RdtDisconnectionErrorRPRRVRY(R"tattemptsR'RU((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR*ks0      cCsa|idj oMd|i_d|i_|ii|iƒ|iiiƒ|_d|_ndS(s"Separate this connection from its Pool. This means that the connection will no longer be returned to the pool when closed, and will instead be literally closed. The containing ConnectionRecord is separated from the DB-API connection, and will create a new connection when next used. Note that any overall connection limiting constraints imposed by a Pool implementation may be violated after a detach, as the detached connection is removed from the pool's knowledge and control. N( RdRIRNR^RbR9RDtcopyRf(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytdetach‡s   cCs1|id8_|idjo|iƒndS(Nii(RhRm(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRœscCs/t|i|i|iƒd|_d|_dS(N(RaRNRdRbRI(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRm¡s (s_pools __counters connections_connection_records __weakref__s_detached_infoN(RFRGRHt __slots__R(tpropertyRiRjRDRIRVRnRuR*RyRRm(((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR)'s       RocBs5eZdZd„Zdd„Zd„Zd„ZRS( t__parentRntexecutecCs"||_||_|i|_dS(N(t_CursorFairy__parentRnR}(R"tparentRn((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR(©s  cCs|iid|ƒdS(NRU(R~RV(R"RU((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRV®scCs“y|iiƒWn{tj oo}yt|ƒ}Wntj ot|ƒ}nX|iiid|ƒt |t t fƒo‚qnXdS(NsError closing cursor: ( RnRRZtstrt TypeErrortreprR~RitwarnR[RQRR(R"RUtex_text((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR±scCst|i|ƒS(N(RsRn(R"Rt((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRu¾s(s__parentscursorsexecuteN(RFRGRzR(RIRVRRu(((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRo¦s    tSingletonThreadPoolcBsYeZdZdd„Zd„Zd„Zd„Zd„Zd„Zd„Z d „Z RS( s A Pool that maintains one connection per thread. Maintains one connection per each thread, never moving a connection to a thread other than the one which it was created in. This is used for SQLite, which both does not handle multithreading by default, and also requires a singleton connection if a :memory: database is being used. Options are the same as those of :class:`Pool`, as well as: :param pool_size: The number of threads in which to maintain connections at once. Defaults to five. icKsEt|d((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR0âs cCsCt|idƒo,|iiƒ}|ii|ƒ|i`ndS(NR1(R8R†R1Rˆtdiscard(R"R>((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyt dispose_localñscCsLxEt|iƒD]4}|ii|ƒt|iƒ|ijodSqWdS(N(tlistRˆR‹tlenR‰(R"R>((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytcleanup÷s cCsdt|ƒt|iƒfS(Ns"SingletonThreadPool id:%d size: %d(tidRŽRˆ(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR?ýscCsdS(N((R"R>((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR9scCs‘y|iiƒ}|o|SWntj onX|iƒ}ti|ƒ|i_|ii|ƒt|iƒ|i jo|i ƒn|S(N( R†R1R2R-R3R4RˆtaddRŽR‰R(R"Rr((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR<s  ( RFRGRHR(R/R0RŒRR?R9R<(((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR…Ás      t QueuePoolcBsqeZdZdddd„Zd„Zd„Zd„Zd„Zd „Zd „Z d „Z d „Z d „Z RS(s>A Pool that imposes a limit on the number of open connections.ii icKsnti|||ti|ƒ|_d||_||_||_|idjo tiƒpd|_ dS(sÝ Construct a QueuePool. :param creator: a callable function that returns a DB-API connection object. The function will be called with parameters. :param pool_size: The size of the pool to be maintained. This is the largest number of connections that will be kept persistently in the pool. Note that the pool begins with no connections; once this number of connections is requested, that number of connections will remain. Defaults to 5. :param max_overflow: The maximum overflow size of the pool. When the number of checked-out connections reaches the size set in pool_size, additional connections will be returned up to this limit. When those additional connections are returned to the pool, they are disconnected and discarded. It follows then that the total number of simultaneous connections the pool will allow is pool_size + `max_overflow`, and the total number of "sleeping" connections the pool will allow is pool_size. `max_overflow` can be set to -1 to indicate no overflow limit; no limit will be placed on the total number of concurrent connections. Defaults to 10. :param timeout: The number of seconds to wait before giving up on returning a connection. Defaults to 30. :param recycle: If set to non -1, number of seconds between connection recycling, which means upon checkout, if this timeout is surpassed the connection will be closed and replaced with a newly opened connection. Defaults to -1. :param echo: If True, connections being pulled and retrieved from the pool will be logged to the standard output, as well as pool sizing information. Echoing can also be achieved by enabling logging for the "sqlalchemy.pool" namespace. Defaults to False. :param use_threadlocal: If set to True, repeated calls to :meth:`connect` within the same application thread will be guaranteed to return the same connection object, if one has already been retrieved from the pool and has not been returned yet. Offers a slight performance advantage at the cost of individual transactions by default. The :meth:`unique_connection` method is provided to bypass the threadlocal behavior installed into :meth:`connect`. :param reset_on_return: If true, reset the database state of connections returned to the pool. This is typically a ROLLBACK to release locks and transaction resources. Disable at your own peril. Defaults to True. :param listeners: A list of :class:`~sqlalchemy.interfaces.PoolListener`-like objects or dictionaries of callables that receive events when DB-API connections are created, checked out and checked in to the pool. iiÿÿÿÿN( RR(tQueueRbt _overflowt _max_overflowt_timeoutRtLockRIt_overflow_lock(R"R#RŠt max_overflowttimeoutR ((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR(s ?   cCs\|idƒt|id|iid|id|id|id|id|i d|i ƒS( NsPool recreatingRŠR™RšR$RR%R( RR’RRbtmaxsizeR•R–RRPRR(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR/Zs cCsˆy|ii|tƒWnjtij o[|idjo|id8_q„|iiƒz|id8_Wd|ii ƒXnXdS(Ni( RbtputRJR“tFullR˜RIR”tacquiretrelease(R"R>((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR9^s cCsry<|idjo|i|ij}|ii||iƒSWn/tij o |idjoT|i|ijoA|p |iƒSti d|i ƒ|i ƒ|ifƒ‚n|i dj o|i iƒn|idjo?|i|ijo,|i dj o|i iƒn|iƒSz|iƒ}|id7_Wd|i dj o|i iƒnX|SXdS(NiÿÿÿÿsPQueuePool limit of size %d overflow %d reached, connection timed out, timeout %di(R•R”RbR=R–R“tEmptyR<Rt TimeoutErrorR‰toverflowR˜RIRžRŸR-(R"twaittcon((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR<ks("# /#  cCs…xFto>y |iitƒ}|iƒWqtij oPqXqWd|iƒ|_|i o|i d|i ƒƒndS(NisPool disposed. ( RKRbR=RJRR“R R‰R”RPRR?(R"R>((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR0†s  cCs2|iƒ|iƒ|iƒ|iƒf}d|S(Ns_Pool size: %d Connections in pool: %d Current Overflow: %d Current Checked out connections: %d(R‰t checkedinR¢t checkedout(R"ttup((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR?’s*cCs |iiS(N(RbR›(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR‰–scCs |iiƒS(N(Rbtqsize(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR¥™scCs|iS(N(R”(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR¢œscCs|ii|iiƒ|iS(N(RbR›R¨R”(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR¦Ÿs( RFRGRHR(R/R9R<R0R?R‰R¥R¢R¦(((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR’sF      tNullPoolcBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(sQA Pool which does not pool connections. Instead it literally opens and closes the underlying DB-API connection per each connection open/close. Reconnect-related functions such as ``recycle`` and connection invalidation are not supported by this Pool implementation, since no connections are held persistently. cCsdS(NR©((R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR?®scCs|iƒdS(N(R(R"R>((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR9±scCsdS(N((R"R>((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytdo_return_invalid´scCs |iƒS(N(R-(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR<·sc Cs>|idƒt|id|id|id|id|iƒS(NsPool recreatingR$RR%R(RR©RRRPRR(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR/ºs      cCsdS(N((R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR0Ãs( RFRGRHR?R9RªR<R/R0(((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR©¢s      t StaticPoolcBsVeZdZd„Zd„Zd„Zd„Zd„Zd„Zd„Z d„Z RS( s.A Pool of exactly one connection, used for all requests. Reconnect-related functions such as ``recycle`` and connection invalidation (which is also used to support auto-reconnect) are not currently supported by this Pool implementation but may be implemented in a future release. cKs2ti||||ƒ|_t|ƒ|_dS(sö Construct a StaticPool. :param creator: a callable function that returns a DB-API connection object. The function will be called with parameters. :param echo: If True, connections being pulled and retrieved from the pool will be logged to the standard output, as well as pool sizing information. Echoing can also be achieved by enabling logging for the "sqlalchemy.pool" namespace. Defaults to False. :param reset_on_return: If true, reset the database state of connections returned to the pool. This is typically a ROLLBACK to release locks and transaction resources. Disable at your own peril. Defaults to True. :param listeners: A list of :class:`~sqlalchemy.interfaces.PoolListener`-like objects or dictionaries of callables that receive events when DB-API connections are created, checked out and checked in to the pool. N(RR(R†R,RN(R"R#R ((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR(Ñs cCsdS(NR«((R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR?ïscCs|iiƒd|_dS(N(R†RRI(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR0òs c CsM|idƒ|id|id|id|id|id|id|iƒS(NsPool recreatingR#R$R%R&RR(RRSRRRRRR(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR/ös     cCs|iS(N(R†(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR-ÿscCsdS(N((R"R>((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR9scCsdS(N((R"R>((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRªscCs|iS(N(RN(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR<s( RFRGRHR(R?R0R/R-R9RªR<(((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR«Çs      t AssertionPoolcBsDeZdZd„Zd„Zd„Zd„Zd„Zd„ZRS(söA Pool that allows at most one checked out connection at any given time. This will raise an exception if more than one connection is checked out at a time. Useful for debugging code that is using more connections than desired. cKs2ti|||t|ƒ|_|i|_dS(s Construct an AssertionPool. :param creator: a callable function that returns a DB-API connection object. The function will be called with parameters. :param recycle: If set to non -1, number of seconds between connection recycling, which means upon checkout, if this timeout is surpassed the connection will be closed and replaced with a newly opened connection. Defaults to -1. :param echo: If True, connections being pulled and retrieved from the pool will be logged to the standard output, as well as pool sizing information. Echoing can also be achieved by enabling logging for the "sqlalchemy.pool" namespace. Defaults to False. :param use_threadlocal: If set to True, repeated calls to :meth:`connect` within the same application thread will be guaranteed to return the same connection object, if one has already been retrieved from the pool and has not been returned yet. Offers a slight performance advantage at the cost of individual transactions by default. The :meth:`unique_connection` method is provided to bypass the threadlocal behavior installed into :meth:`connect`. :param reset_on_return: If true, reset the database state of connections returned to the pool. This is typically a ROLLBACK to release locks and transaction resources. Disable at your own peril. Defaults to True. :param listeners: A list of :class:`~sqlalchemy.interfaces.PoolListener`-like objects or dictionaries of callables that receive events when DB-API connections are created, checked out and checked in to the pool. N(RR(R,RNR†(R"R#R ((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR(s(cCsdS(NR¬((R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR?CscCstdƒ‚dS(NtInvalid(tAssertionError(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR-FscCs ||_dS(N(RN(R"R>((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR9IscCstdƒ‚dS(NR­(R®(R"R>((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRªMscCs|i}d|_|S(N(RNRI(R"Rr((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR<Ps  ( RFRGRHR(R?R-R9RªR<(((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR¬ s ,    R cBsYeZdZed„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z RS( s Layers connection pooling behavior on top of a standard DB-API module. Proxies a DB-API 2.0 connect() call to a connection pool keyed to the specific connect parameters. Other functions and attributes are delegated to the underlying DB-API module. cKs7||_||_||_h|_tiƒ|_dS(s×Initializes a new proxy. module a DB-API 2.0 module poolclass a Pool class, defaulting to QueuePool Other parameters are sent to the Pool object's constructor. N(R R t poolclasstpoolsRR—t_create_pool_mutex(R"R R¯R ((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR(^s    cCs(x!|iiƒD]}|i|=qWdS(N(R°tkeys(R"Rt((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRpscCs|iƒdS(N(R(R"((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyt__del__tscCst|i|ƒS(N(RsR (R"Rt((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRuwscs®ˆiˆˆŽ}yˆi|SWn†tj ozˆiiƒzU|ˆijo6ˆi‡‡‡fd†ˆi}|ˆi|<|Sˆi|SWdˆiiƒXnXdS(NcsˆiiˆˆŽS((R R7((R"RpR (s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyRg‚s(t _serializeR°RR±RžR¯R RŸ(R"RpR RtRO((R"RpR s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pytget_poolzs $ cOs|i||ŽiƒS(s+Activate a connection to the database. Connect to the database using this DBProxy's module and the given connect arguments. If the arguments match an existing pool, the connection will be returned from the pool's current thread-local connection instance, or if there is no thread-local connection instance it will be checked out from the set of pooled connections. If the pool has no available connections and allows new connections to be created, a new database connection will be made. (RµR7(R"RpR ((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR7Šs cOs:|i||Ž}y|i|=Wntj onXdS(sFDispose the connection pool referenced by the given connect arguments.N(R´R°R(R"RpR Rt((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR0™s cOsti||gƒS(N(Rtdumps(R"RpR ((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR´¢s( RFRGRHR’R(RR³RuRµR7R0R´(((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyR Vs       (RHR3RWRt sqlalchemyRRRR“tsqlalchemy.utilRRRR RtobjectRR,RIRaR)RoR…R’R©R«R¬R (((s3/usr/lib/python2.6/site-packages/sqlalchemy/pool.pyts$$  ‰L P‘%EJ