Our Preferred 5 Star Hosting Provider - Award Wining FileMaker Pro Hosting
Results 1 to 8 of 8

Thread: Commit vs. Save

  1. #1
    Moderator Feirefiz's Avatar
    Join Date
    May 2013
    Posts
    290
    Location
    Switzerland
    FileMaker Version
    FM 12 Developer
    OS
    Mac
    Skill Level
    Intermediate
    Downloads
    0
    Uploads
    0

    Commit vs. Save

    The Scarpetta Group- our preferred FMT Forum Consultants
    What's the difference between saving and commiting a record? Are fields saved as you go along and then records committed once you leave it? I've noticed during data entry that you can only use the built-in undo function for the field you are in, not for previous fields, and yet the record is not committed.

    Outside of scripting, is there a practical difference between them?

  2. #2
    Senior Moderator - FMT Preferred Developer Consultant - New York - Worldwide AHunter3's Avatar
    Join Date
    Aug 2006
    Posts
    11,443
    Location
    New York and Nassau County, NY, USA
    FileMaker Version
    FM 9, FM 9 Server, FM 10, FM 11, FM 11 Server, FM 12, FM 12 Developer
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    In manual data entry, each field is "saved" but the record not committed as you exit the field by tabbing from field to field while doing data entry. Thus a field validation formula can kick up an error message when you enter 2/30/13 as the Due Date because that's not a valid date, and so on.

    On a really literal level, there is a temporary file on your hard drive as you edit records which contains your changes thus far; minor edits get written to this cache file which then gets flushed back to the actual database (whether hosted on server or host elsewhere or simply located somewhere else on your local computer). Until the record is committed the changes are not considered flush-worthy, they're "potential changes".

    Even committed records do not (necessarily) get flushed to the live database immediately, but they're now eligible. Usually committed = permanently saved and pretty much instantaneously at that, but exceptions exist, for example:

    • Replace Field Contents or Relookup (the entire found set of records being affected by this operation, the flush to disk usually won't occur until after the entire operation is complete or the cache is full, as opposed to one rec at a time)

    • Scripted operations involving loops (unless an explicit Flush Cache to Disk is executed within the loop, several loops may iterate between actual flushes)

    • Delete All Records (as with Replace and Relookup operations, these are usually flushed to disk in chunks, not one rec at a time)




    Ignoring (for the moment) this occasional gap between committing and actually writing the change to disk, the uncommitted record to which field value changes have been made can be reverted in its entirety from the Revert Record command in the Records menu (or the corresponding script command in a script, usually set off within an IF statement). Once the record is committed you can't revert it.


    In seriously bad cases of OH $^#@@! I WISH I HADN'T DONE THAT, such as someone executing a Replace Field Contents on 239,407 records instead of the 13 intended records; or doing a Find/Replace to change all occurrences of "FM" to "FileMaker" (before you realize that "Hoffman and Baron" will now be "HofFileMakeran and Baron" through the system) or something like that, when you are a guest on a networked database you can make use of the flush gap by yanking out the ethernet cable or force-quitting FileMaker or yanking the power plug out of a desktop computer, etc — the changes have probably not been pushed back to the host and interrupting the network connection will not generally damage the hosted database.
    Last edited by AHunter3; 07-09-2013 at 11:48 AM.

  3. #3
    Senior Moderator - FMT Preferred Developer Consultant Arizona, NM, Texas, Southwest USA
    Join Date
    Mar 2006
    Posts
    2,725
    Location
    So. Arizona
    FileMaker Version
    FM 10, FM 10 Server
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by AHunter3 View Post
    Scripted operations involving loops (unless an explicit Flush Cache to Disk is executed within the loop, several loops may iterate between actual flushes)
    This may explain something that has perplexed me for a while: When I create a loop, and use the

    SET WINDOW TITLE ("Updating " & Get (RecordNumber) & " of " & Get (FoundCount) )

    so as to reflect progress (the Window title is outside of FM, so updates show dynamically), the record number jumps in blocks per iteration. I would suspect that this is the flush cache cycle that is being reflected?

    Also, if you uncheck the layout options "Save Record Changes Automatically", would you not then REQUIRE a COMMIT to save the record??

  4. #4
    Senior Moderator - FMT Preferred Developer Consultant... New York, New England and Global Josh Ormond's Avatar
    Join Date
    Jun 2007
    Posts
    2,592
    Location
    Rochester, NY
    FileMaker Version
    FM 10 Server, FM 11 Server, FM 12
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by kirkrr View Post
    the record number jumps in blocks per iteration.
    It can be. The other variable is the redraw. Sometimes the screen will only draw so many times. It may be picking up the broadcast from FM and only updating a certain interval. But the behavior you describe is often the result in an update being pushed after a commit.

    Quote Originally Posted by kirkrr View Post
    Also, if you uncheck the layout options "Save Record Changes Automatically", would you not then REQUIRE a COMMIT to save the record??
    To save the record back to the host file, yes a commit is required. But that is true in any case. The difference is mainly the extra step to confirm changes before they are sent to the host/committed.

    The record save as you tab from field-to-field happens regardless. Obviously, something needs to ask the user to save the record. Which FM does by default if you do something that would normally commit the record.
    Josh Ormond ~ Senior Moderator
    Your Philosophy: "Simplicity is the answer for Complexity."
    My Reply: "It takes a great deal of Complexity to make something Simple. Have you seen Google.com?"

    Check out my blog: The FileMaker Rift [RSS]
    ==================================================
    Looking for FileMaker help? Become a member of the FileMaker Cafe today [click here].
    Have questions contact me here: Email

  5. #5
    Moderator Feirefiz's Avatar
    Join Date
    May 2013
    Posts
    290
    Location
    Switzerland
    FileMaker Version
    FM 12 Developer
    OS
    Mac
    Skill Level
    Intermediate
    Downloads
    0
    Uploads
    0
    Thank you, AHunter, for the instructive post. What happens when you've manually entered data in a record and quit FileMaker (cmd-q) with an open record, without performing an action that causes records to commit (at least according to the list on FM's website)? It seems to me the data is saved/committed – at least as far as it's not a hosted file/IWP.

  6. #6
    Senior Moderator - FMT Preferred Developer Consultant - New York - Worldwide AHunter3's Avatar
    Join Date
    Aug 2006
    Posts
    11,443
    Location
    New York and Nassau County, NY, USA
    FileMaker Version
    FM 9, FM 9 Server, FM 10, FM 11, FM 11 Server, FM 12, FM 12 Developer
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    Yes, if you ⌘-Q out of FileMaker and it is sitting on an uncommitted record, FileMaker commits the record as part of the process of shutting down. It also flushes anything in its cache that needs to be flushed back to the host, or, if running as the host itself, closes the file properly.

    IWP is a totally different story. Web browsers do not KNOW they are displaying a database's information. They may or may not be set up to "do something" when you quit and your screen simply happens to have a form with form data on it — depends on your web browser and your personal preferences, but FileMaker itself has no control over it. At best the end user might get a warning "you edited something on this web page, are you sure you want to close this tab?"

  7. #7
    Moderator Feirefiz's Avatar
    Join Date
    May 2013
    Posts
    290
    Location
    Switzerland
    FileMaker Version
    FM 12 Developer
    OS
    Mac
    Skill Level
    Intermediate
    Downloads
    0
    Uploads
    0
    Very clear. Thank you.

  8. #8
    Senior Moderator - FMT Preferred Developer Consultant... New York, New England and Global Josh Ormond's Avatar
    Join Date
    Jun 2007
    Posts
    2,592
    Location
    Rochester, NY
    FileMaker Version
    FM 10 Server, FM 11 Server, FM 12
    OS
    Windows & Mac
    Skill Level
    Developer
    Downloads
    0
    Uploads
    0
    If you get an instance where the power goes out, or everything is frozen and now actions are able to finish performing, any uncommitted data is lost. As is any data not flushed to the host.
    Josh Ormond ~ Senior Moderator
    Your Philosophy: "Simplicity is the answer for Complexity."
    My Reply: "It takes a great deal of Complexity to make something Simple. Have you seen Google.com?"

    Check out my blog: The FileMaker Rift [RSS]
    ==================================================
    Looking for FileMaker help? Become a member of the FileMaker Cafe today [click here].
    Have questions contact me here: Email

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Save a copy as doesn't save
    By cschmitz in forum ScriptMaker and Scripting
    Replies: 1
    Last Post: 03-11-2010, 09:39 AM
  2. Record Commit
    By dante_in_calgary in forum FileMaker Pro 10 Advanced
    Replies: 9
    Last Post: 06-03-2009, 12:33 PM
  3. Save image (container) and - separately - save file name?
    By VA12 in forum Calculations and Define Fields
    Replies: 6
    Last Post: 11-24-2008, 03:02 PM
  4. Commit records over Web
    By BPEX in forum ScriptMaker and Scripting
    Replies: 0
    Last Post: 08-20-2007, 04:56 PM
  5. Record Commit
    By GarryBargsley in forum FileMaker Pro 8.0
    Replies: 1
    Last Post: 02-16-2006, 08:45 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Welcome to the Original FileMaker Forum
With designated forums for almost every FileMaker topic...FileMaker Today is a free-to-join community where you can boost your FileMaker expertise, build better solutions and solve your technical challenges. If you're building FileMaker solutions, this is the place for you.
Follow FMT
We Are FMT
FMT is home of The World's leading FileMaker News Site, Worldwide Developer Directory, FileMaker Connect Community and so much more.