WordPress.org

Ready to get started?Download WordPress

Forums

When does database commit? (3 posts)

  1. srp0uk
    Member
    Posted 6 years ago #

    Hi,

    when does the wordpress database commit? Is it instant, or is it and the end of the loop?

    I ask this because I have a plugin that calls the same function twice, and on the first run it inserts something to a table, and on the second run it needs to check that whatever was inserted...

    I am thinking that the function won't work like this unless I manually commit after the first run...am I right?

  2. Samuel Wood (Otto)
    Tech Ninja
    Posted 6 years ago #

    Nah, you most likely won't need to manually commit unless you're doing something really complex.

    WordPress closes the connection to the database after every hit to the site, so that will commit if commit has not taken place manually.

  3. srp0uk
    Member
    Posted 6 years ago #

    Hmm, ok, thanks for the prompt reply.

Topic Closed

This topic has been closed to new replies.

About this Topic