TransactionBegin (NotesDatabase - LotusScript)

Begins recording changes to a database on a Domino server.

Defined in

NotesDatabase

Syntax

Call notesDatabase.TransactionBegin()

Usage

  • Begins recording changes to a database. The changes take effect after a call to TransactionCommit.
  • The TransactionBegin call can be made from a server or from a client that accesses a database on a server.
  • Transaction logging must be enabled in the Domino Server document.
  • If any error occurs after TransactionBegin is called, all changes are discarded.
  • Always call TransactionCommit or TransactionRollback prior to allowing the database to go out of scope or changes may be lost.
Note: For important information about using Transaction methods, see Effects of using transaction controls.

Example

Sub Initialize
   Dim s as new NotesSession
   Dim db as NotesDatabase
   Dim doc as NotesDocument
   Set db = s.GetDatabase("myserver", "mydb")
   Call db.TransactionBegin()
   Set doc = db.CreateDocument()
   Call doc.ReplaceItemValue("Form", "Memo")
   Call doc.ReplaceItemValue("Subject", "TestDoc")
   Call doc.save(True, False)
   Call db.TransactionCommit()
End Sub