Does TOraSession.AutoCommit overrides TOraQuery.AutoCommit ?
Does TOraSession.AutoCommit overrides TOraQuery.AutoCommit ?
Which Autocommit rules if TOraSession.AutoCommit=False and TOraQuery/TOraTable.AutoCommit=True ?
Hello,
The TOraSession.AutoCommit property defines global behaviour for all DataSets connected to this TOraSession, the TOraQuery.AutoCommit property defines behaviour of the current DataSet. Below is a small example that demonstrates differences in behaviour depending on the values of these properties:
The TOraSession.AutoCommit property defines global behaviour for all DataSets connected to this TOraSession, the TOraQuery.AutoCommit property defines behaviour of the current DataSet. Below is a small example that demonstrates differences in behaviour depending on the values of these properties:
Code: Select all
OraSQL.Session := OraSession;
OraSession.AutoCommit := True;
OraSQL.AutoCommit := False;
OraSQL.SQL.Text := 'DELETE FROM TABLE';
OraSQL.Execute; // delete all records, commit is not performed
OraSession.Rollback;// restore deleted records
OraSession.AutoCommit := False;
OraSQL.AutoCommit := True;
OraSQL.SQL.Text := 'DELETE FROM TABLE';
OraSQL.Execute; // delete all records, commit is not performed
OraSession.Rollback; // restore deleted records
OraSession.AutoCommit := True;
OraSQL.AutoCommit := True;
OraSQL.SQL.Text := 'DELETE FROM TABLE';
OraSQL.Execute; // delete all records, commit is performed
OraSession.Rollback; // couldn't restore deleted records