summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/orm/identity.py
Commit message (Collapse)AuthorAgeFilesLines
* - copyright 2015Mike Bayer2015-03-101-1/+1
|
* - Mapped state internals have been reworked to allow for a 50% reductionMike Bayer2015-02-181-1/+8
| | | | | | | | 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
* - use a faster discard when loadingMike Bayer2014-08-291-0/+13
| | | | - don't do a bool on identity map since it calls __len__
* - need list() here for py3kMike Bayer2014-08-161-1/+4
|
* - The :class:`.IdentityMap` exposed from :class:`.Session.identity`Mike Bayer2014-08-151-26/+8
| | | | | | now returns lists for ``items()`` and ``values()`` in Py3K. Early porting to Py3K here had these returning iterators, when they technically should be "iterable views"..for now, lists are OK.
* - apply pep8 formatting to sqlalchemy/sql, sqlalchemy/util, sqlalchemy/dialects,Brian Jarrett2014-07-201-3/+3
| | | | 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
* - fix some identity map accessorsMike Bayer2014-05-241-0/+39
| | | | - fix a bad comparison in MySQL w/ limit/offset thing
* - fix typos in testMike Bayer2014-05-241-0/+3
| | | | - restore __len__ to identity map
* - some inlining, speed up identity mapMike Bayer2014-05-191-32/+46
|
* - happy new yearMike Bayer2014-01-051-1/+1
|
* - spot checking of imports, obsolete functionsMike Bayer2013-08-171-1/+1
|
* clean up some of this collection stuffMike Bayer2013-05-261-2/+1
|
* do a sweep of some obvious 3kismsMike Bayer2013-05-261-25/+21
|
* - the raw 2to3 runMike Bayer2013-04-271-24/+26
| | | | - went through examples/ and cleaned out excess list() calls
* happy new year (see #2645)Diana Clarke2013-01-011-1/+1
|
* just a pep8 pass of lib/sqlalchemy/orm/Diana Clarke2012-11-191-6/+14
|
* don't need this is_really_none() thing anymoreMike Bayer2012-08-081-9/+1
|
* -whitespace bonanza, contdMike Bayer2012-07-281-1/+1
|
* - move all of orm to use absolute importsMike Bayer2012-06-231-1/+1
| | | | | | | | - break out key mechanics of loading objects into new "orm.loading" module, removing implementation details from both mapper.py and query.py. is analogous to persistence.py - some other cleanup and old cruft removal
* - [removed] The legacy "mutable" system of theMike Bayer2012-04-231-13/+2
| | | | | | | | | | | | | | ORM, including the MutableType class as well as the mutable=True flag on PickleType and postgresql.ARRAY has been removed. In-place mutations are detected by the ORM using the sqlalchemy.ext.mutable extension, introduced in 0.7. The removal of MutableType and associated constructs removes a great deal of complexity from SQLAlchemy's internals. The approach performed poorly as it would incur a scan of the full contents of the Session when in use. [ticket:2442]
* happy new yearMike Bayer2012-01-041-1/+1
|
* - Identity map .discard() uses dict.pop(,None)Mike Bayer2011-09-091-2/+2
| | | | | internally instead of "del" to avoid KeyError/warning during a non-determinate gc teardown [ticket:2267]
* - Fixed a potential KeyError which under someMike Bayer2011-04-251-2/+2
| | | | | circumstances could occur with the identity map, part of [ticket:2148]
* - some changes to the identity map regardingMike Bayer2011-03-041-80/+45
| | | | | | | | | | | | rare weakref callbacks during iterations. The mutex has been removed as it apparently can cause a reentrant (i.e. in one thread) deadlock, perhaps when gc collects objects at the point of iteration in order to gain more memory. It is hoped that "dictionary changed during iteration" will be exceedingly rare as iteration methods internally acquire the full list of objects in a single values() call. [ticket:2087]
* - whitespace removal bonanzaMike Bayer2011-01-021-33/+33
|
* - clean up copyright, update for 2011, stamp every file withMike Bayer2011-01-021-2/+2
| | | | | a consistent tag - AUTHORS file
* - another heap of inlinings and now I really have to be done with thisMike Bayer2010-12-211-5/+12
|
* - remove the need to use LoadDeferredColumns, LoadLazyAttribute in most cases,Mike Bayer2010-12-161-10/+21
| | | | | | | | | these are back to being part of LoaderStrategy - simplify attribute.get() - inline the dict get inside of attribute.__get__() - revert some memoized attrs from InstanceState which are called in almost all cases regardless - inlining
* - inliningsMike Bayer2010-12-161-5/+4
| | | | - in particular, mapper.primary_key is a tuple now
* - Added a mutex to the identity map which mutexesMike Bayer2010-09-071-28/+49
| | | | | | | | remove operations against iteration methods, which now pre-buffer before returning an iterable. This because asyncrhonous gc can remove items via the gc thread at any time. [ticket:1891]
* - For those who might use debug logging onMike Bayer2010-02-131-1/+3
| | | | | | | | | | sqlalchemy.orm.strategies, most logging calls during row loading have been removed. These were never very helpful and cluttered up the code. - Some internal streamlining of object loading grants a small speedup for large results, estimates are around 10-15%.
* remove needless check_modified()Mike Bayer2010-01-071-1/+1
|
* gratuitous try/except/else usageMike Bayer2009-10-181-1/+2
|
* dohMike Bayer2009-08-311-1/+1
|
* - Fixed incorrect exception raise inMike Bayer2009-08-311-5/+9
| | | | | Weak/StrongIdentityMap.add() [ticket:1506]
* - renamed PASSIVE_NORESULT to PASSIVE_NO_RESULTMike Bayer2009-08-071-3/+8
| | | | | | | | | | | | | | | | - renamed PASSIVE_NO_CALLABLES to PASSIVE_NO_FETCH - passive now propagates all the way through lazy callables, all the way into query._get(), so that many-to-one lazy load can load the instance via the local session but not trigger any SQL if not available, fixes [ticket:1298] without messing up consistency of tests added in r6201 - many-to-one also handles returning PASSIVE_NO_RESULT for the "old" value thus eliminating the need for the previous value even if the new value is None - query._get() uses identity_map.get(), which has been changed to no longer raise KeyError, thus providing mythical time savings that didn't seem to make any difference in how fast the unit tests ran.
* merge 0.6 series to trunk.Mike Bayer2009-08-061-8/+27
|
* Guard against a gc hitting during the sweep for dirty objects.Jason Kirtland2009-07-161-4/+5
|
* - Removed all* O(N) scanning behavior from the flush() process,Mike Bayer2009-05-171-15/+16
| | | | | | | | | | | i.e. operations that were scanning the full session, including an extremely expensive one that was erroneously assuming primary key values were changing when this was not the case. * one edge case remains which may invoke a full scan, if an existing primary key attribute is modified to a new value.
* - Significant performance enhancements regarding Sessions/flush()Mike Bayer2009-05-171-61/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in conjunction with large mapper graphs, large numbers of objects: - The Session's "weak referencing" behavior is now *full* - no strong references whatsoever are made to a mapped object or related items/collections in its __dict__. Backrefs and other cycles in objects no longer affect the Session's ability to lose all references to unmodified objects. Objects with pending changes still are maintained strongly until flush. [ticket:1398] The implementation also improves performance by moving the "resurrection" process of garbage collected items to only be relevant for mappings that map "mutable" attributes (i.e. PickleType, composite attrs). This removes overhead from the gc process and simplifies internal behavior. If a "mutable" attribute change is the sole change on an object which is then dereferenced, the mapper will not have access to other attribute state when the UPDATE is issued. This may present itself differently to some MapperExtensions. The change also affects the internal attribute API, but not the AttributeExtension interface nor any of the publically documented attribute functions. - The unit of work no longer genererates a graph of "dependency" processors for the full graph of mappers during flush(), instead creating such processors only for those mappers which represent objects with pending changes. This saves a tremendous number of method calls in the context of a large interconnected graph of mappers. - Cached a wasteful "table sort" operation that previously occured multiple times per flush, also removing significant method call count from flush(). - Other redundant behaviors have been simplified in mapper._save_obj().
* - Generalized the IdentityManagedState._instance_dict() callableMike Bayer2009-01-051-7/+5
| | | | | | | to the IdentityMap class so that Weak/StrongInstanceDict both have the same behavior wrt the state referencing the map - Fixed bug when using weak_instance_map=False where modified events would not be intercepted for a flush(). [ticket:1272]
* - converted some more attributes to @memoized_property in expressionsMike Bayer2008-11-101-8/+9
| | | | | - flattened an unnecessary KeyError in identity.py - memoized the default list of mapper properties queried in MapperEntity.setup_context
* - Improved weakref identity map memory management to no longerMike Bayer2008-10-191-43/+46
| | | | | require mutexing, resurrects garbage collected instance on a lazy basis for an InstanceState with pending changes.
* - identity_map._mutable_attrs is a plain dict since we manage weakref ↵Mike Bayer2008-10-021-2/+2
| | | | | | removal explicitly - call list() around iteration of _mutable_attrs to guard against async gc.collect() while check_modified() is running
* Updated some todos.Jason Kirtland2008-05-211-1/+0
|
* r4695 merged to trunk; trunk now becomes 0.5.Mike Bayer2008-05-091-0/+250
0.4 development continues at /sqlalchemy/branches/rel_0_4