Coder Social home page Coder Social logo

``load(oid)`` must die! about zodb HOT 5 CLOSED

zopefoundation avatar zopefoundation commented on May 29, 2024
``load(oid)`` must die!

from zodb.

Comments (5)

jamadden avatar jamadden commented on May 29, 2024

On RelStorage, lastTransaction() (even with your partial patch) isn't set until some load() operation is requested. That is, RelStorage doesn't read from the DB by itself (e.g., when a storage is created), and only reading from the DB initializes lastTransaction().

Maybe this isn't a problem with the machinery of Connection, maybe it guarantees a call to load() before trying to use lastTransaction(). (Note that sync() alone isn't sufficient.) But it is a problem using the storage directly, one must be aware of the order requirements.

Maybe this is flat out a bug in RelStorage and it should read from the DB if those values are uninitialized.

from zodb.

jimfulton avatar jimfulton commented on May 29, 2024

This is moot because with #66, Connection won't be calling lastTransaction on RelStorage instances.

from zodb.

jamadden avatar jamadden commented on May 29, 2024

Good deal!

Does ClientStorage have a valid/correct lastTransaction() immediately after it is created (in the same way FileStorage does)? If so, it still might make sense to change RelStorage to behave like the other storages in this way (that would eliminate the one special-case remaining in zodbconvert).

from zodb.

jimfulton avatar jimfulton commented on May 29, 2024

WRT clientStorage and lastTransaction, it's value is "valid" when it's created, but may be z64 until it has connected. (z64 is technically valid, but generally way out of date. :))

from zodb.

jimfulton avatar jimfulton commented on May 29, 2024

Long live loadBefore!

from zodb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.