| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added native "pessimistic disconnection" handling to the :class:`.Pool`
object. The new parameter :paramref:`.Pool.pre_ping`, available from
the engine as :paramref:`.create_engine.pool_pre_ping`, applies an
efficient form of the "pre-ping" recipe featured in the pooling
documentation, which upon each connection check out, emits a simple
statement, typically "SELECT 1", to test the connection for liveness.
If the existing connection is no longer able to respond to commands,
the connection is transparently recycled, and all other connections
made prior to the current timestamp are invalidated.
Change-Id: I89700d0075e60abd2250e54b9bd14daf03c71c00
Fixes: #3919
|
|
|
|
| |
Change-Id: I4e8c2aa8fe817bb2af8707410fa0201f938781de
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- add a connect=True key to connection record to support
pre-loading of _ConnectionRecord objects
- ensure _ConnectionRecord.close() leaves the record in a good
state for reopening
- add _ConnectionRecord.record_info for persistent storage
- add "in_use" accessor based on fairy_ref being present or not
- allow for the exclusions system and SuiteRequirements to be
usable without the full plugin_base setup.
- move some Python-env requirements to the importable
requirements.py module.
- allow starttime to be queried
- add additional events for engine plugins
- have "dialect" be a first-class parameter to the pool,
ensure the engine strategy supplies it up front
Change-Id: Ibf549f7a1766e49d335cd6f5e26bacfaef9a8229
|
| |
|
|
|
|
| |
back by using an attrgetter for the default case
|
|
|
|
|
|
|
|
|
| |
This supports the use case of an application that uses the same set of
:class:`.Table` objects in many schemas, such as schema-per-user.
A new execution option
:paramref:`.Connection.execution_options.schema_translate_map` is
added. fixes #2685
- latest tox doesn't like the {posargs} in the profile rerunner
|
|
|
|
|
|
|
|
|
|
|
| |
be stated in the query string for a URL. Custom plugins can
be written which will be given the chance up front to alter and/or
consume the engine's URL and keyword arguments, and then at engine
create time will be given the engine itself to allow additional
modifications or event registration. Plugins are written as a
subclass of :class:`.CreateEnginePlugin`; see that class for
details.
fixes #3536
|
|
|
|
| |
the URL design a little simpler
|
|
|
|
|
|
|
|
| |
:meth:`.URL.get_dialect` method will continue to return the
ultimate :class:`.Dialect` object when a dialect plugin is used,
without the need for the caller to be aware of the
:meth:`.Dialect.get_dialect_cls` method.
reference #3379
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
functionality. Added a new "soft invalidate" feature to the
connection pool at the level of the checked out connection wrapper
as well as the :class:`._ConnectionRecord`. This works similarly
to a modern pool invalidation in that connections aren't actively
closed, but are recycled only on next checkout; this is essentially
a per-connection version of that feature. A new event
:class:`.PoolEvents.soft_invalidate` is added to complement it.
fixes #3379
- Added new flag
:attr:`.ExceptionContext.invalidate_pool_on_disconnect`.
Allows an error handler within :meth:`.ConnectionEvents.handle_error`
to maintain a "disconnect" condition, but to handle calling invalidate
on individual connections in a specific manner within the event.
- Added new event :class:`.DialectEvents.do_connect`, which allows
interception / replacement of when the :meth:`.Dialect.connect`
hook is called to create a DBAPI connection. Also added
dialect plugin hooks :meth:`.Dialect.get_dialect_cls` and
:meth:`.Dialect.engine_created` which allow external plugins to
add events to existing dialects using entry points.
fixes #3355
|
| |
|
|
|
|
|
|
|
|
|
| |
take effect in all engine connection use cases, including
when user-custom connect routines are used via the
:paramref:`.create_engine.creator` parameter, as well as when
the :class:`.Connection` encounters a connection error on
revalidation.
fixes #3266
|
|
|
|
|
| |
that union() can be called, in the case of a dialect that uses
execution options inside of initialize() (e.g. oursql)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
:paramref:`.create_engine.execution_options` or
:meth:`.Engine.update_execution_options` are not passed to the
special :class:`.Connection` used to initialize the dialect
within the "first connect" event; dialects will usually
perform their own queries in this phase, and none of the
current available options should be applied here. In
particular, the "autocommit" option was causing an attempt to
autocommit within this initial connect which would fail with
an AttributeError due to the non-standard state of the
:class:`.Connection`.
fixes #3200
|
| |
|
|
|
|
| |
to get all flake8 passing
|
|
|
|
|
|
|
|
|
|
|
| |
- Fixed bug which would occur if a DBAPI exception
occurs when the engine first connects and does its initial checks,
and the exception is not a disconnect exception, yet the cursor
raises an error when we try to close it. In this case the real
exception would be quashed as we tried to log the cursor close
exception via the connection pool and failed, as we were trying
to access the pool's logger in a way that is inappropriate
in this very specific scenario. fixes #3063
|
|
|
|
|
| |
and :func:`.event.listens_for`. This is a convenience feature which
will wrap the given listener such that it is only invoked once.
|
| |
|
|
|
|
|
|
|
|
| |
we will be able to parse dialect-specific arguments from string
configuration dictionaries. Dialect classes can now provide their
own list of parameter types and string-conversion routines.
The feature is not yet used by the built-in dialects, however.
[ticket:2875]
|
|
|
|
|
|
|
|
|
|
|
|
| |
of dbapi.Error (such as ``TypeError``, ``NotImplementedError``, etc.)
will propagate the exception unchanged. Previously,
the error handling specific to the ``connect()`` routine would both
inappropriately run the exception through the dialect's
:meth:`.Dialect.is_disconnect` routine as well as wrap it in
a :class:`sqlalchemy.exc.DBAPIError`. It is now propagated unchanged
in the same way as occurs within the execute process. [ticket:2881]
- add tests for this in test_parseconnect, but also add tests in test_execute
to ensure the execute() behavior as well
|
|
|
|
|
|
| |
is recreated, due to a disconnect error. This fixes a particular
issue in the Oracle 8 dialect, but in general the dialect.initialize()
phase should only be once per dialect. Also in 0.8.3. [ticket:2776]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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()
|
| |
|
|
|
|
| |
- went through examples/ and cleaned out excess list() calls
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
| |
MockConnection (i.e., that used with
strategy="mock") which acts as a pass through
for arguments.
|
|
|
|
|
|
|
|
| |
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]
|
|
|
|
|
|
| |
correct DDL visit method wasn't called, resulting
in "CREATE/DROP SEQUENCE" statements being
duplicated [ticket:2384]
|
| |
|
|
|
|
| |
- fix the test for separately installed pysqlite
|
|
|
|
|
|
|
|
|
|
|
|
| |
will forward the error to dialect.is_disconnect()
and set the "connection_invalidated" flag if
the dialect knows this to be a potentially
"retryable" condition. Only Oracle ORA-01033
implemented for now. [ticket:2201]
- Added ORA-01033 to disconnect codes, which
can be caught during a connection
event. [ticket:2201]
|
|
|
|
|
|
|
| |
Connection/Engine that were never well known
and are redundant: reflecttable(), create(),
drop(), text(), engine.func
- lots of docstrings in engine
|
|
|
|
|
|
|
|
| |
- simplify connection event model to be inline inside Connection, don't use ad-hoc
subclasses (technically would leak memory for the app that keeps creating engines
and adding events)
- not doing listen-per-connection yet. this is closer. overall things
are much simpler now (until we put listen-per-connection in...)
|
|
|
|
|
| |
- this test keeps throwing a TNS error on Oracle on the buildbot only, runs locally,
seems to be related to some scaling/memory type of issue on the bot
|
|
|
|
|
|
|
|
| |
call are now wrapped in sqlalchemy.exc.StatementError,
and the text of the SQL statement and repr() of params
is included. This makes it easier to identify statement
executions which fail before the DBAPI becomes
involved. [ticket:2015]
|
| |
|
|
|
|
|
| |
a consistent tag
- AUTHORS file
|
| |
|
| |
|
|
|
|
|
|
| |
based databases. :memory: databases will continue
to select SingletonThreadPool by default.
[ticket:1921]
|
|
|
|
|
| |
- added "pool_events" arg to create_engine(), "events" to pool, allowing
establishment of listeners which fire before those of the dialect
|
|
|
|
|
|
|
| |
and....doesn't work.
on_before_execute and on_after_execute really not appealing here. might have to just go back to
what it was the other day.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
def listen(target, args)
so here we provide a "wrapper" approach that allows this, and it is
basically pass-by-value. a pass-by-value event *may* support rewriting
some of the args in the dictionary.
the current
listen will become "listen_raw" since it saves about 100% overhead versus
the coercion to dict, and will be used internally, and will remain
pass-by-reference.
proxyconnection probably will rely upon the newer style of pass-by-value
for "rewrite the args" types of calls.
|
|
|
|
|
|
|
|
|
| |
with methods representing events. This is self-documenting via sphinx.
- implemented new model for pool, classmanager. Most events are
one or two args, so going back to allowing any kind of *arg, **kw
signature for events - this is simpler and improves performance,
though we don't get the "we can add new kw's anytime". perhaps
there's some other way to approach that.
|
|
|
|
|
|
|
|
| |
on_connect(). This method returns a callable which receives
the raw DBAPI connection after each one is created. The callable
is assembled into a first_connect/connect pool listener by the
connection strategy if non-None. Provides a simpler interface
for dialects.
|
|
|
|
|
|
|
| |
as well as "pool_logging_name" argument to create_engine() which
filters down to that of Pool. Issues the given string name
within the "name" field of logging messages instead of the default
hex identifier string. [ticket:1555]
|