summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/session.py
Commit message (Collapse)AuthorAgeFilesLines
* fix typo int->intopr/192halfcrazy2015-08-091-1/+1
|
* - Fixed bug where the state tracking within multiple, nestedMike Bayer2015-04-021-0/+1
| | | | | | | | | :meth:`.Session.begin_nested` operations would fail to propagate the "dirty" flag for an object that had been updated within the inner savepoint, such that if the enclosing savepoint were rolled back, the object would not be part of the state that was expired and therefore reverted to its database state. fixes #3352
* - Added a list() call around a weak dictionary used within theMike Bayer2015-04-011-1/+1
| | | | | | commit phase of the session, which without it could cause a "dictionary changed size during iter" error if garbage collection interacted within the process. Change was introduced by
* - Fixed bug where the session attachment error "object is alreadyMike Bayer2015-03-101-7/+7
| | | | | | | attached to session X" would fail to prevent the object from also being attached to the new session, in the case that execution continued after the error raise occurred. fixes #3301
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - remove the need for a recursive call hereMike Bayer2015-02-201-5/+12
|
* - Fixed bug where internal assertion would fail in the case whereMike Bayer2015-02-201-2/+5
| | | | | | | | an ``after_rollback()`` handler for a :class:`.Session` incorrectly adds state to that :class:`.Session` within the handler, and the task to warn and remove this state (established by :ticket:`2389`) attempts to proceed. fixes #3309
* - Mapped state internals have been reworked to allow for a 50% reductionMike Bayer2015-02-181-3/+7
| | | | | | | | in callcounts specific to the "expiration" of objects, as in the "auto expire" feature of :meth:`.Session.commit` and for :meth:`.Session.expire_all`, as well as in the "cleanup" step which occurs when object states are garbage collected. fixes #3307
* - A warning is emitted if the ``isolation_level`` parameter is usedMike Bayer2015-02-041-8/+33
| | | | | | | | | | | | | | | | with :meth:`.Connection.execution_options` when a :class:`.Transaction` is in play; DBAPIs and/or SQLAlchemy dialects such as psycopg2, MySQLdb may implicitly rollback or commit the transaction, or not change the setting til next transaction, so this is never safe. - Added new parameter :paramref:`.Session.connection.execution_options` which may be used to set up execution options on a :class:`.Connection` when it is first checked out, before the transaction has begun. This is used to set up options such as isolation level on the connection before the transaction starts. - added new documentation section detailing best practices for setting transaction isolation with sessions. fixes #3296
* - correctionsMike Bayer2014-12-271-2/+2
| | | | - attempt to add a script to semi-automate the fixing of links
* - Added new method :meth:`.Session.invalidate`, functions similarlyMike Bayer2014-12-121-2/+40
| | | | | | | | | | to :meth:`.Session.close`, except also calls :meth:`.Connection.invalidate` on all connections, guaranteeing that they will not be returned to the connection pool. This is useful in situations e.g. dealing with gevent timeouts when it is not safe to use the connection further, even for rollbacks. references #3258
* - A new series of :class:`.Session` methods which provide hooksMike Bayer2014-12-081-22/+37
| | | | | | | | | | directly into the unit of work's facility for emitting INSERT and UPDATE statements has been created. When used correctly, this expert-oriented system can allow ORM-mappings to be used to generate bulk insert and update statements batched into executemany groups, allowing the statements to proceed at speeds that rival direct use of the Core. fixes #3100
* - add an option for bulk_save -> update to not do historyMike Bayer2014-12-071-11/+21
|
* - fix inheritance persistenceMike Bayer2014-12-071-0/+158
| | | | - start writing docs
* - initial tests for bulkMike Bayer2014-12-071-1/+2
|
* Merge branch 'master' into ticket_3100Mike Bayer2014-11-061-47/+61
|\
| * - Fixed bug where :meth:`.Session.expunge` would not fully detachMike Bayer2014-10-191-4/+8
| | | | | | | | | | | | | | the given object if the object had been subject to a delete operation that was flushed, but not committed. This would also affect related operations like :func:`.make_transient`. fixes #3139
| * - Improvements to the mechanism used by :class:`.Session` to locateMike Bayer2014-10-141-43/+53
| | | | | | | | | | | | | | "binds" (e.g. engines to use), such engines can be associated with mixin classes, concrete subclasses, as well as a wider variety of table metadata such as joined inheritance tables. fixes #3035
* | - add options to get back pk defaults for inserts.Mike Bayer2014-09-021-7/+9
| | | | | | | | times spent start getting barely different...
* | Merge branch 'master' into ticket_3100Mike Bayer2014-09-021-5/+5
|\ \ | |/
| * - need to use safe_discard() at least in _restore_snapshot(), let's use itMike Bayer2014-08-291-3/+3
| | | | | | | | everywhere in Session since the optimized one only applies to loading
| * - use a faster discard when loadingMike Bayer2014-08-291-2/+2
| | | | | | | | - don't do a bool on identity map since it calls __len__
* | - refinementsMike Bayer2014-08-191-19/+10
| |
* | - change to be represented as two very fast bulk_insert() and bulk_update() ↵Mike Bayer2014-08-151-28/+29
| | | | | | | | methods
* | devMike Bayer2014-08-151-6/+17
| |
* | - proof of conceptMike Bayer2014-08-151-0/+34
|/
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-159/+164
| | | | sqlalchemy/orm, sqlalchemy/event, sqlalchemy/testing
* - break up the <authors> copyright comment as part of a passMike Bayer2014-07-091-1/+2
| | | | to get all flake8 passing
* - Fixed bug where items that were persisted, deleted, or had aMike Bayer2014-07-011-1/+4
| | | | | | | primary key change within a savepoint block would not participate in being restored to their former state (not in session, in session, previous PK) after the outer transaction were rolled back. fixes #3108
* - Adjustment to attribute mechanics concerning when a value isMike Bayer2014-05-291-25/+25
| | | | | | | | | | | | | | implicitly initialized to None via first access; this action, which has always resulted in a population of the attribute, now emits an attribute event just like any other attribute set operation and generates the same kind of history as one. Additionally, many mapper internal operations will no longer implicitly generate these "None" values when various never-set attributes are checked. These are subtle behavioral fixes to attribute mechanics which provide a better solution to the problem of :ticket:`3060`, which also involves recognition of attributes explicitly set to ``None`` vs. attributes that were never set. fixes #3061
* Fix many typos throughout the codebasepr/85Alex Gaynor2014-04-261-2/+2
| | | | Found using: https://github.com/intgr/topy
* Added some links in session docsbenselme2014-04-231-35/+39
|
* - Added new utility function :func:`.make_transient_to_detached` which canMike Bayer2014-04-091-1/+35
| | | | | | | be used to manufacture objects that behave as though they were loaded from a session, then detached. Attributes that aren't present are marked as expired, and the object can be added to a Session where it will act like a persistent one. fix #3017
* -rewrite expire/refresh sectionMike Bayer2014-02-231-0/+24
|
* - happy new yearMike Bayer2014-01-051-1/+1
|
* Don't barf on Session(info=...) from sessionmaker(info=None)Robin Schoonover2013-12-311-1/+2
|
* load_on_pending is different from enable_relationship_loading and shouldMike Bayer2013-12-151-2/+8
| | | | not be superseded. both have a potential use.
* - The :class:`.exc.StatementError` or DBAPI-related subclassMike Bayer2013-12-111-1/+12
| | | | | | | | | | now can accomodate additional information about the "reason" for the exception; the :class:`.Session` now adds some detail to it when the exception occurs within an autoflush. This approach is taken as opposed to combining :class:`.FlushError` with a Python 3 style "chained exception" approach so as to maintain compatibility both with Py2K code as well as code that already catches ``IntegrityError`` or similar.
* - documentation cleanup in ORM including [ticket:2816]Mike Bayer2013-12-071-2/+3
|
* Merge pull request #45 from timka/patch-1mike bayer2013-11-291-1/+1
|\ | | | | Fix sessionmaker.__repr__
| * Fix sessionmaker.__repr__pr/45Timur2013-11-161-1/+1
| | | | | | A comma separating 'class_' from the other args. It's still there even when kw is empty, which is syntactically correct.
* | Generate API and resolve cross referencesVraj Mohan2013-11-171-1/+1
|/
* - spot checking of imports, obsolete functionsMike Bayer2013-08-171-2/+1
|
* - apply an import refactoring to the ORM as wellMike Bayer2013-08-141-31/+41
| | | | | | | | | - 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
* Added a new attribute :attr:`.Session.info` to :class:`.Session`;Mike Bayer2013-08-021-2/+42
| | | | | | | | this is a dictionary where applications can store arbitrary data local to a :class:`.Session`. The contents of :attr:`.Session.info` can be also be initialized using the ``info`` argument of :class:`.Session` or :class:`.sessionmaker`.
* a pass where we try to squash down as many list()/keys() combinationsMike Bayer2013-05-261-4/+4
| | | | as possible
* merge defaultMike Bayer2013-04-301-3/+4
|\
| * - Fixed a regression from 0.7 where the contextmanager featureMike Bayer2013-04-301-3/+4
| | | | | | | | | | | | | | of :meth:`.Session.begin_nested` would fail to correctly roll back the transaction when a flush error occurred, instead raising its own exception while leaving the session still pending a rollback. [ticket:2718]
* | - the raw 2to3 runMike Bayer2013-04-271-10/+10
|/ | | | - went through examples/ and cleaned out excess list() calls
* - dont do a boolean check on the mapped objectMike Bayer2013-04-201-1/+1
|