transactionRollback (Database - Java)

Discards database changes recorded by transactionBegin.

Defined in

Database

Syntax

Database.transactionRollback();

Usage

transactionRollback can be called only after transactionBegin.

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.transactionRollback();
   } catch(Exception e) {
	e.printStackTrace();
}