Commit Graph

28 Commits

Author SHA1 Message Date
Mike Bayer 4a6afd469f r4695 merged to trunk; trunk now becomes 0.5.
0.4 development continues at /sqlalchemy/branches/rel_0_4
2008-05-09 16:34:10 +00:00
Jason Kirtland afd8431d4d - Pool listeners may now be specified as a duck-type of PoolListener or a dict of callables, your choice. 2008-04-04 19:07:30 +00:00
Mike Bayer c0b5a0446b - updated the naming scheme of the base test classes in test/testlib/testing.py;
tests extend from either TestBase or ORMTest, using additional mixins for
special assertion methods as needed
2008-02-11 00:28:39 +00:00
Jason Kirtland 17d3c8764e - testbase is gone, replaced by testenv
- Importing testenv has no side effects- explicit functions provide similar behavior to the old immediate behavior of testbase
- testing.db has the configured db
- Fixed up the perf/* scripts
2008-01-12 22:03:42 +00:00
Jason Kirtland ea627ebe5c Migrated Connection.properties to Connection.info ('info' is the new standard name for user-writable property collections that came out of [ticket:573]). 'properties' is now an alias, will be removed in 0.5. 2007-11-18 18:19:52 +00:00
Jason Kirtland 7f85c1e443 - Pool listeners preserved on pool.recreate()
- Docstring rampage
2007-11-10 19:31:06 +00:00
Mike Bayer 04e70c708f changing Pool to use weakref callback for auto-cleanup, instead of __del__.
Still leaving the RLock in Queue however since I see no guarantee that the weakref callback
isn't called at an arbitrary time.
2007-08-21 18:18:21 +00:00
Mike Bayer 531faf0e18 - Engine and TLEngine assume "threadlocal" behavior on Pool; both use connect()
for contextual connection, unique_connection() for non-contextual.
- Pool use_threadlocal defaults to True, can be set to false at create_engine()
level with pool_threadlocal=False
- made all logger statements in pool conditional based on a flag calcualted once.
- chagned WeakValueDictionary() used for "threadlocal" pool to be a regular dict
referencing weakref objects.  WVD had a lot of overhead, apparently.  *CAUTION* -
im pretty confident about this change, as the threadlocal dict gets explicitly managed
anyway, tests pass with PG etc., but keep a close eye on this one regardless.
2007-08-20 19:07:07 +00:00
Mike Bayer 95748cfc02 - added extra argument con_proxy to ConnectionListener interface checkout/checkin methods
- changed testing connection closer to work on _ConnectionFairy instances, resulting in
pool checkins, not actual closes
- disabled session two phase test for now, needs work
- added some two-phase support to TLEngine, not tested
- TLTransaction is now a wrapper
2007-08-17 17:59:08 +00:00
Mike Bayer 23140c926b -merged 0.3 pool threadlocal fix from r3139 2007-08-02 00:02:16 +00:00
Jason Kirtland 9f10023179 Added pool hooks for connection creation, check out and check in. 2007-07-28 19:51:55 +00:00
Mike Bayer ed4fc64bb0 merging 0.4 branch to trunk. see CHANGES for details. 0.3 moves to maintenance branch in branches/rel_0_3. 2007-07-27 04:08:53 +00:00
Mike Bayer c1bf74462f assert timeout is 3 seconds, not 2 2007-07-20 15:41:42 +00:00
Mike Bayer 687d9342e6 - a new mutex that was added in 0.3.9 causes the pool_timeout
feature to fail during a race condition; threads would
raise TimeoutError immediately with no delay if many threads
push the pool into overflow at the same time.  this issue has been
fixed.
2007-07-20 15:10:56 +00:00
Mike Bayer dc19e4eda6 - adjustments to pool locking test to fail on OSX
- restored conditional locking to pool, for all conditions of max_overflow > -1
2007-06-30 16:35:54 +00:00
Mike Bayer de61eb3509 - added a mutex to QueuePool's "overflow" calculation to prevent a race
condition that can bypass max_overflow; merged from 0.4 branch r2736-2738.
also made the locking logic simpler, tried to get the test to create a
failure on OSX (not successful)
2007-06-30 01:14:15 +00:00
Jason Kirtland 98207edf30 - Connections can be detached from their pool, closing on dereference instead of returning to the pool for reuse 2007-05-09 22:39:50 +00:00
Mike Bayer 6d6c546b0e a rudimental reconnect/pool auto-dispose test. not super-comprehensive but better
than nothing, will close #516
2007-04-22 00:30:39 +00:00
Mike Bayer b81a0132a8 added "recreate()" argument to connection pool classes
this method is called when the invalidate() occurs for a disconnect condition,
so that the entire pool is recreated, thereby avoiding repeat errors on
remaining connections in the pool.
dispose() called as well (also fixed up) but cant guarantee all connections closed.
2007-04-17 00:21:25 +00:00
Rick Morrison 30b20e3c56 MSSQL now passes still more unit tests [ticket:481]
Fix to null FLOAT fields in mssql-trusted.patch
MSSQL: LIMIT with OFFSET now raises an error
MSSQL: can now specify Windows authorization
MSSQL: ignores seconds on DATE columns (DATE fix, part 1)
2007-03-15 02:31:15 +00:00
Mike Bayer e249e56cb9 - fix to connection pool _close() to properly clean up, fixes
MySQL synchronization errors [ticket:387]
2006-12-08 18:47:20 +00:00
Mike Bayer 6e565f7231 - some new Pool utility classes, updated docs
- "use_threadlocal" on Pool defaults to False (same as create_engine)
2006-10-24 21:32:13 +00:00
Mike Bayer e812785c2d - logging is now implemented via standard python "logging" module.
"echo" keyword parameters are still functional but set/unset
log levels for their respective classes/instances.  all logging
can be controlled directly through the Python API by setting
INFO and DEBUG levels for loggers in the "sqlalchemy" namespace.
class-level logging is under "sqlalchemy.<module>.<classname>",
instance-level logging under "sqlalchemy.<module>.<classname>.<hexid>".
Test suite includes "--log-info" and "--log-debug" arguments
which work independently of --verbose/--quiet.  Logging added
to orm to allow tracking of mapper configurations, row iteration
fixes [ticket:229] [ticket:79]
2006-09-24 23:59:22 +00:00
Mike Bayer 47332cb147 - changed "invalidate" semantics with pooled connection; will
instruct the underlying connection record to reconnect the next
time its called.  "invalidate" will also automatically be called
if any error is thrown in the underlying call to connection.cursor().
this will hopefully allow the connection pool to reconnect to a
database that had been stopped and started without restarting
the connecting application [ticket:121]
2006-08-26 21:32:11 +00:00
Mike Bayer 8260ca2723 - cleanup on connection methods + documentation. custom DBAPI
arguments specified in query string, 'connect_args' argument
to 'create_engine', or custom creation function via 'creator'
function to 'create_engine'.
- added "recycle" argument to Pool, is "pool_recycle" on create_engine,
defaults to 3600 seconds; connections after this age will be closed and
replaced with a new one, to handle db's that automatically close
stale connections [ticket:274]
2006-08-25 16:27:10 +00:00
Mike Bayer 43d3b77307 - unit tests updated to run without any pysqlite installed; pool
test uses a mock DBAPI
2006-08-21 20:01:32 +00:00
Mike Bayer dc1cc365c2 when QueuePool times out it raises a TimeoutError instead of
erroneously making another connection
2006-06-26 02:06:44 +00:00
Mike Bayer 120dcee5a7 reorganized unit tests into subdirectories 2006-06-05 17:25:51 +00:00