summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/pool.py
Commit message (Collapse)AuthorAgeFilesLines
* move FAQ to the docs, [ticket:2133]Mike Bayer2013-08-211-4/+4
|
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-3/+1
| | | | | | | | | - rework the event system so that event modules load after their targets, dependencies are reversed - create an improved strategy lookup system for the ORM - rework the ORM to have very few import cycles - move out "importlater" to just util.dependency - other tricks to cross-populate modules in as clear a way as possible
* - assorted fixes raised by pypy 2.1beta2, but all of which are goodMike Bayer2013-08-011-1/+2
| | | | | | | | | | | | | | | ideas in general: - pypy2.1 w/ sqlite3 is the first DBAPI we're seeing returning unicode in cursor.description without being py3k. add a new on-connect check for this, if we get back a u"", just don't do description decoding, should be OK for now. - the set tests in test_collection were assuming the two sets would be ordered the same when it tested pop(), can't really assume that. - test_serializer gets worse and worse, pickle is just not really viable here, ding out pypy - pypy2.1b2 seems to allow cursor.lastrowid to work (or we changed something?) - pool._threadconns.current() is a weakref, it can be None - another one of those logging.handlers imports
* Fixed bug where :class:`.QueuePool` would lose the correctMike Bayer2013-07-041-1/+6
| | | | | | checked out count if an existing pooled connection failed to reconnect after an invalidate or recycle event. Also in 0.8.3. [ticket:2772]
* - refactor pool a bit so that intent between ↵Mike Bayer2013-07-021-86/+112
| | | | | | | | | | | | | | ConnectionRecord/ConnectionFairy is clear; make sure that the DBAPI connection passed to the reset-on-return events/dialect hooks is also a "fairy", so that dictionaries like "info" are available. [ticket:2770] - rework the execution_options system so that the dialect is given the job of making any immediate adjustments based on a set event. move the "isolation level" logic to use this new system. Also work things out so that even engine-level execution options can be used for things like isolation level; the dialect attaches a connect-event handler in this case to handle the task. - to support this new system as well as further extensibiltiy of execution options add events engine_connect(), set_connection_execution_options(), set_engine_execution_options()
* Preserve reset_on_return when recreating a Pool.pr/6Eevee2013-06-101-0/+3
|
* Added pool logging for "rollback-on-return" and the less usedMike Bayer2013-06-091-6/+13
| | | | | | "commit-on-return". This is enabled with the rest of pool "debug" logging. [ticket:2752]
* a pass where we try to squash down as many list()/keys() combinationsMike Bayer2013-05-261-1/+1
| | | | as possible
* - the raw 2to3 runMike Bayer2013-04-271-6/+6
| | | | - went through examples/ and cleaned out excess list() calls
* - remove all compat items that are pre-2.5 (hooray)Mike Bayer2013-03-091-2/+2
| | | | | | - other cleanup - don't need compat.decimal, that approach never panned out. hopefully outside libs aren't pulling it in, they shouldn't be
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* - recognize that do_rollback() and do_commit() work with a DBAPI connection,Mike Bayer2012-11-221-26/+50
| | | | | | | | | | | | | | | | | | whereas the other do_rollback_twophase(), savepoint etc. work with :class:`.Connection`. the context on these are different as twophase/savepoint are available at the :class:`.Connection` level, whereas commit/rollback are needed at a lower level as well. Rename the argument to "dbapi_connection" when the conneciton is in fact the DBAPI interface. - start thinking about being able to track "autocommit" vs. "commit", but not sure we have a need for this yet. - have Pool call out to a Dialect for all rollback/commit/close operations now. Pool no longer calls DBAPI methods directly. May use this for a workaround for [ticket:2611] - add a new Pool event reset() to allow the pool's reset of the connection to be intercepted. - remove methods in Informix dialect which appear to be hardcoding some isolation settings on new Transaction only; the isolation API should be implemented for Informix. also removed "flag" for transaction commit/rollback being not available; this should be based on server/DBAPI version and we will need someone with test access in order to help determine how this should work
* just a pep8 pass of lib/sqlalchemy/Diana Clarke2012-11-191-4/+20
|
* - [feature] Added support for .info dictionary argument toMike Bayer2012-08-241-17/+17
| | | | | | column_property(), relationship(), composite(). All MapperProperty classes have an auto-creating .info dict available overall.
* -whitespace bonanza, contdMike Bayer2012-07-281-48/+48
|
* absolute imports in core, sqlMike Bayer2012-06-231-3/+3
|
* - [bug] Fixed bug wherebyMike Bayer2012-06-221-33/+49
| | | | | | | | | | | | a disconnect detect + dispose that occurs when the QueuePool has threads waiting for connections would leave those threads waiting for the duration of the timeout on the old pool. The fix now notifies those waiters with a special exception case and has them move onto the new pool. This fix may or may not be ported to 0.7. [ticket:2522]
* - [feature] Dramatic improvement in memoryMike Bayer2012-06-201-1/+3
| | | | | | | | usage of the event system; instance-level collections are no longer created for a particular type of event until instance-level listeners are established for that event. [ticket:2516] Also in 0.7.9.
* Add some `Sphinx` paragraph level versions informations markups,Mike Bayer2012-06-081-22/+25
| | | | such as ``.. versionadded::``, ``.. versionchanged::`` and ``.. deprecated::``.
* typoDiana Clarke2012-03-161-1/+1
|
* accept the symbols so recreate worksMike Bayer2012-02-011-4/+5
|
* - [feature] Added pool_reset_on_return argumentMike Bayer2012-02-011-7/+48
| | | | | | | | to create_engine, allows control over "connection return" behavior. Also added new arguments 'rollback', 'commit', None to pool.reset_on_return to allow more control over connection return activity. [ticket:2378]
* - [bug] Added a boolean check for the "finalize"Mike Bayer2012-01-271-1/+1
| | | | | | | | | function within the pool connection proxy's weakref callback before calling it, so that a warning isn't emitted that this function is None when the application is exiting and gc has removed the function from the module before the weakref callback was invoked. [ticket:2383]
* happy new yearMike Bayer2012-01-041-1/+1
|
* ensure sa_pool_key isn't passed to connectMike Bayer2011-09-211-0/+1
|
* - Added optional "sa_pool_key" argument toMike Bayer2011-09-201-0/+3
| | | | | pool.manage(dbapi).connect() so that serialization of args is not necessary.
* document pool ping recipeMike Bayer2011-08-241-3/+4
|
* - The recreate() method in all pool classes usesMike Bayer2011-08-141-4/+4
| | | | | | | self.__class__ to get at the type of pool to produce, in the case of subclassing. Note there's no usual need to subclass pools. [ticket:2254]
* - The "pool.manage" feature doesn't use pickleMike Bayer2011-04-051-2/+5
| | | | anymore to hash the arguments for each pool.
* - AssertionPool now stores the traceback indicatingMike Bayer2011-03-301-4/+18
| | | | | | | | where the currently checked out connection was acquired; this traceback is reported within the assertion raised upon a second concurrent checkout; courtesy Gunnlaugur Briem [ticket:2103]
* - Fixed bug in QueuePool, SingletonThreadPool wherebyMike Bayer2011-03-221-1/+3
| | | | | | | | | connections that were discarded via overflow or periodic cleanup() were not explicitly closed, leaving garbage collection to the task instead. This generally only affects non-reference-counting backends like Jython and Pypy. Thanks to Jaimy Azle for spotting this. [ticket:2102]
* - some doc reorgMike Bayer2011-03-171-3/+3
| | | | | | | | | | - change engine.Connection to _connection_cls so sphinx doesn't get upset - globally add "." to all :class:`Foo` - start naming sections that are mostly docstrings "API Documentation - blah blah" - move some ad-hoc docstrings into "API" sections, there is some inconsistency here and it may be that we just have to leave it that way - add "internals" rsts to core, orm, I'm not super thrilled how these look but they are targeted by some of the public api docs, users typically become aware of these anyway
* - Fixed AssertionPool regression bug. A replacement of finalizeMike Bayer2011-03-161-7/+0
| | | | | | logic did the wrong thing, but then also the logic it replaced also doesn't seem like its needed. If it is, would rather have a test case first so its out for now, added tests for assertionpool. [ticket:2097]
* corrected a bunch of spelling typosDiana Clarke2011-02-281-1/+1
|
* - add connection and cursor to is_disconnect(). We aren't using it yet,Mike Bayer2011-02-091-5/+1
| | | | | | | | | | | | | | | but we'd like to. Most DBAPIs don't give us anything we can do with it. Some research was done on psycopg2 and it still seems like they give us no adequate method (tried connection.closed, cursor.closed, connection.status). mxodbc claims their .closed attribute will work (but I am skeptical). - remove beahvior in pool that auto-invalidated a connection when the cursor failed to create. That's not the pool's job. we need the conn for the error logic. Can't get any tests to fail, curious why that behavior was there, guess we'll find out (or not). - add support for psycopg2 version detection. even though we have no use for it yet... - adjust one of the reconnect tests to work with oracle's horrendously slow connect speed
* - execution_options() on Connection acceptsMike Bayer2011-01-161-0/+5
| | | | | | | | | | "isolation_level" argument, sets transaction isolation level for that connection only until returned to the connection pool, for thsoe backends which support it (SQLite, Postgresql) [ticket:2001] - disallow the option on Engine (use isolation_level to create_engine()), Executable (we don't want to check/set per statement) - docs
* - whitespace removal bonanzaMike Bayer2011-01-021-41/+41
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-3/+2
| | | | | a consistent tag - AUTHORS file
* - removes the "on_" prefix.Mike Bayer2010-12-301-10/+10
|
* - factor out the dependency on the "on_" nameMike Bayer2010-12-301-1/+1
|
* - move topological, queue into utilMike Bayer2010-12-051-1/+1
| | | | | - move function_named into test.lib.util - use @decorator for all decorators in test/
* - reduce some pool overheadMike Bayer2010-12-051-21/+26
|
* - ResultProxy and friends always reference the DBAPI connection at the same timeMike Bayer2010-12-051-38/+1
| | | | | | | | as the cursor. There is no reason for CursorFairy - the only use case would be, end-user is using the pool or pool.manage with DBAPI connections, uses a cursor, deferences the owning connection and continues using cursor. This is an almost nonexistent use case and isn't correct usage at a DBAPI level. Take out CursorFairy. - move the "check for a dot in the colname" logic out to the sqlite dialect.
* new calling style: event.listen(target, identifier, fn)Mike Bayer2010-12-011-1/+1
|
* - Pooling methods now underscored or removed:Mike Bayer2010-11-281-45/+29
| | | | | | | | | | | | | Pool.create_connection() -> Pool._create_connection() Pool.do_get() -> Pool._do_get() Pool.do_return_conn() -> Pool._do_return_conn() Pool.do_return_invalid() -> removed, was not used Pool.return_conn() -> Pool._return_conn() Pool.get() -> Pool._get(), public API is Pool.connect() SingletonThreadPool.cleanup() -> _cleanup() SingletonThreadPool.dispose_local() -> removed, use conn.invalidate() [ticket:1982]
* - NullPool is now used by default for SQLite file-Mike Bayer2010-11-281-6/+15
| | | | | | based databases. :memory: databases will continue to select SingletonThreadPool by default. [ticket:1921]
* - fixes for PG, mysql, twophaseMike Bayer2010-11-201-1/+11
| | | | | - added "pool_events" arg to create_engine(), "events" to pool, allowing establishment of listeners which fire before those of the dialect
* - logging has been overhauled such that engines no longer need to encode theMike Bayer2010-11-201-1/+1
|\ | | | | | | | | "hex id" string in their logging name in order to maintain separate loggers per engine. thanks to Vinay Sajip for assistance. merge of [ticket:1926]
| * - initial patch for [ticket:1926]Mike Bayer2010-11-171-1/+1
| |
* | dingMike Bayer2010-11-071-1/+1
| |