transactionCommit (Database - Java)

Makes changes to a database in a batch after a transactionBegin call.

Defined in

Database

Syntax

Database.transactionCommit();

Usage

transactionCommit can be called only after transactionBegin. If the database being changed is closed before transactionCommit is called, all recorded changes are discarded and do not take effect.

Example

try {
   Session session = getSession();
   AgentContext ac = session.getAgentContext();
   Database db = session.getDatabase("myserver", "mydb.nsf");
   db.transactionBegin();
   Document doc = db.createDocument();
   doc.replaceItemValue("Form", "Memo");
   doc.replaceItemValue("Subject", "TestDoc");
   doc.save();
   db.transactionCommit();    
     } catch(Exception e) {
	e.printStackTrace();
}