Giter VIP home page Giter VIP logo

Comments (4)

jamadden avatar jamadden commented on June 19, 2024

_p_mtime is just a wrapper (which loses precision, by the way) around _p_serial. In ZODB, _p_serial is the transaction ID, and transaction IDs always increase; they can never go backwards. When you create the DB, ZODB creates the first transaction to initially create the root object, and thus establishes the baseline for all transaction IDs going forward.

>>> db = ZODB.DB(None)
>>> db._storage.lastTransaction()
b'\x03\xd1\xffFF\xd1+\x00'
>>> db.open().root()._p_serial
b'\x03\xd1\xffFF\xd1+\x00'

When it's time to commit, ZODB essentially says to the TimeStamp class, "give me a TimeStamp based on the current time that's later than the last one I committed." If the clock has gone backwards, it'll be ignored.

from persistent.

icemac avatar icemac commented on June 19, 2024

@jamadden Thank you for your excellent explanation.
@azmeuk Does this explanation answer your question so the issue can be closed?

from persistent.

d-maurer avatar d-maurer commented on June 19, 2024

from persistent.

azmeuk avatar azmeuk commented on June 19, 2024

@jamadden Thank you. Your answer helped me a lot understand what is going on.
@icemac Yep!

from persistent.

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.