commit()

Commits the current transaction in the relationship database.

Syntax

void commit()
 

Parameters

None.

Return values

None.

Exceptions

DtpConnectionException - If a database error occurs.

Notes

The beginTran(), commit() and rollBack() methods together provide transaction support for SQL queries.

Before beginning a transaction, you must create a DtpConnection object with the getRelConnection() method from the BaseDLM class.

Examples

The following example uses a transaction to execute a query for inserting rows into a table in the SapCust relationship.

DtpConnection connection = getRelConnection("SapCust");
  
 // begin a transaction
 connection.beginTran();
  
 // insert a row
 connection.executeSQL("insert...");
  
 // commit the transaction
 connection.commit();
 

See also

beginTran(), getRelConnection(), inTransaction(), rollBack()

Copyright IBM Corp. 1997, 2003