1. 09 Apr, 2004 1 commit
  2. 08 Apr, 2004 1 commit
    • Tim Peters's avatar
      Close a thread race in Connection.close(), diagnosed by Marius Gedminas. · a4375ae9
      Tim Peters authored
      DB._closeConnection() sets the connection's _db member to None now, under
      protection of the lock it holds anyway.  At a deeper level, it's unclear
      why _db keeps getting set and unset to begin with, but no time for that
      now (and there are already XXX comments about it in the code).
      
      Alas, I wasn't able to write a test that provoked the original bug in
      finite time (it's a tiny timing hole), except via calling sleep() between
      two lines that don't exist anymore.  Good enough.
      a4375ae9
  3. 06 Apr, 2004 2 commits
    • Tim Peters's avatar
      ZODB.utils grows a new function positive_id(), which returns the id() of · b0b7489e
      Tim Peters authored
      an object as a non-negative integer.  Code trying to pass addresses to
      an %x format uses positive_id(), and this avoids a Python FutureWarning
      about applying %x to negative ints.  The primary difference between this
      and the last stab is that positive_id() should work OK on 64-bit boxes
      too.  What we really want here is C's %p format code, but in Python we
      can't even reliably know the width of native addresses.
      b0b7489e
    • Tim Peters's avatar
      As part of int/long unification, Python 2.4 will start printing · 771d5748
      Tim Peters authored
      negative ints *as* negative ints when fed into %x formats.  Python 2.3
      still renders them as positive ints, but spews
      
      FutureWarning: %u/%o/%x/%X of negative int will return a signed string
                     in Python 2.4 and up
      
      to warn about the impending change.  Jim reported two instances of that
      warning when running the tests on a box where addresses happen to "be
      negative".  So make the addresses look positive instead (2.3 and 2.4
      treat those the same, so 2.3 doesn't warn about those).
      
      Problem:  it occurs to me now that I'm assuming addresses fit in 32
      bits here.
      771d5748
  4. 02 Apr, 2004 1 commit
  5. 01 Apr, 2004 1 commit
    • Jeremy Hylton's avatar
      Merge the jeremy-txn-branch to the head. · 860e89b9
      Jeremy Hylton authored
      This branch introduces a new transaction API.  The key features are:
        - top-level functions in transaction -- get(), commit(), abort()
        - explicit transaction manager objects
        - Transaction objects are used for exactly one transaction
        - support for transaction synchronizers
      
      The changes here are still provisional, but we want to get them off an
      obscure branch and onto the head for further development.
      860e89b9
  6. 16 Mar, 2004 1 commit
  7. 13 Mar, 2004 1 commit
    • Jeremy Hylton's avatar
      Revise Connection. · 57852925
      Jeremy Hylton authored
      Make _added_during_commit a regular instance variable.  Don't use
      try/finally to reset it; just clear it at the start of a transaction.
      XXX There was a test that needed to be removed, but it seemed to be
      just a shallow test that try/finally was used.  Can't see any feature
      that depends on specific of error handling: The txn is going to abort.
      
      Remove unused _opened instance variable.
      Split commit() into two smaller parts.
      Get rid of extra manipulation of _creating.
      Don't look for _p_serial of None; z64 is now required.
      Undo local variable aliases in subtransaction methods.
      
      Also, trivial change to pickle cache API -- get() works like dict get().
      57852925
  8. 12 Mar, 2004 2 commits
    • Jeremy Hylton's avatar
      Simplify assertions. · 346d92cc
      Jeremy Hylton authored
      346d92cc
    • Jeremy Hylton's avatar
      Remove _noncurrent instance variable. · 0aef7603
      Jeremy Hylton authored
      It's clear in hindsight that the connection only loads non-current
      revisions for objects that have been invalidated.  Thus, we never need
      to track them to invalidate stale objects; they'll be invalidated
      anyway.  And loadBefore() will never return a current revision,
      because it would only be called if the current revision could not be
      used.
      0aef7603
  9. 04 Mar, 2004 3 commits
  10. 02 Mar, 2004 2 commits
  11. 01 Mar, 2004 1 commit
  12. 27 Feb, 2004 4 commits
  13. 26 Feb, 2004 2 commits
    • Jeremy Hylton's avatar
      Add two notes about common use. · bea47025
      Jeremy Hylton authored
      bea47025
    • Jeremy Hylton's avatar
      Add tests, docs, and a bunch of small cleanups. · 9e24d096
      Jeremy Hylton authored
      Add get() as preferred synonym for __getitem__.  Change several uses
          of subscripting to get().
      Change add() to register new object with transaction.
      Change several methods to raise RuntimeError if they are called when
          the Connection is closed.
      Add experimental epydoc markup to doc strings.
      Extend doc strings and write new tests for "User Methods."
      9e24d096
  14. 25 Feb, 2004 2 commits
  15. 24 Feb, 2004 3 commits
  16. 23 Feb, 2004 1 commit
  17. 19 Feb, 2004 1 commit
    • Jeremy Hylton's avatar
      Merge zope3-zodb3-devel-branch to the Zope head (Zope 2 head). · d5327c25
      Jeremy Hylton authored
      Add support for persistent weak references.  The implementation is in
      pure Python right now; coptimizations.c was disabled.  We need to
      restore the C code before going to beta.
      
      The persistent reference format has evolved a little, but the code on
      the branch doesn't document it.  The ref is usually a an oid-class
      pair, where the class is an actual class object.  It can also be a
      list, for weak references, or a bare oid.
      
      Add support for data managers written against the ZODB4 transaction
      API.  The transaction implementation provides an adapter between the
      two interfaces.  There's a substantial doctest test suite for this
      feature.
      
      Add add() method to Connection to explicitly add an object and get it
      an assigned _p_oid.  It's possible to add an unconnected object; this
      isn't recommended, because it will be lost at pack time.
      d5327c25
  18. 14 Jan, 2004 3 commits
    • Jeremy Hylton's avatar
      But we do. · 78146725
      Jeremy Hylton authored
      The comment long ago fell out of synch with the code.
      78146725
    • Jeremy Hylton's avatar
      Revise interface between ExportImport and Connection. · 90476555
      Jeremy Hylton authored
      The Connection class inherits from the ExportImport mixin, but they
      had an arm's length interaction.  Restructure the code to provide
      direct interaction via the _import attribute.
      
      Remove the more general onCommitCallback() method.  It was only used
      by ExportImport.
      
      A lot of cosmetic changes to ExportImport:
          - don't make local variables out of attribute lookups
          - avoid local variable names that shadow builtins
          - prefer isinstance() to type comparisons
          - prefer absolute imports to relative imports
      90476555
    • Jeremy Hylton's avatar
  19. 06 Jan, 2004 5 commits
  20. 02 Jan, 2004 2 commits
  21. 31 Dec, 2003 1 commit