These methods manage transaction processing within a Connection object as follows:
ConnectionObject.BeginTrans(Connection)
Newlook Smartclient
Newlook Server
Connection - (String, Required)
Specifies the name of the Connection object for which the transaction applies.
Newlook will support transactions where they are also supported by the underlying database system. For example, IBM i database files with journaling turned on are capable of supporting transactions.
Use these actions with a Connection object when you want to save or cancel a series of changes made to the source data as a single unit. For example, to transfer money between accounts, you subtract an amount from one and add the same amount to the other. If either update fails, the accounts no longer balance. Making these changes within a transaction ensures that either all or none of the changes go through.
For providers that support nested transactions, calling the BeginTrans method within an open transaction starts a new, nested transaction. The TransactionLevel property of a Connection object indicates the level of nesting: a return value of "1" indicates you have opened a top-level transaction (that is, the transaction is not nested within another transaction), "2" indicates that you have opened a second-level transaction (a transaction nested within a top-level transaction), and so forth. Calling CommitTrans or RollbackTrans affects only the most recently opened transaction; you must close or roll back the current transaction before you can resolve any higher-level transactions.
The isolation level for the transaction is specified in the connection string that was used in the Connect method.
For DDM data sources, journaling for the database file must be set up on the server in order for these actions to succeed. If journaling has not been set up for the database file, then no error will occur but the actions will have no effect. For ADO data sources, support for these actions depends upon the OLE DB provider and may not be available in some Recordsets.
When a transaction is committed or rolled back, a new transaction may be started immediately after the current one ends. For DDM data sources, a new transaction is always started. For ADO data sources this behaviour depends upon the OLE DB provider. The advanced view in the Connection tab of the Database Description dialog shows the behaviour for a particular Recordset. If Retaining Abort is set to True, then a new transaction is started immediately after a transaction is rolled back. If Retaining Commit is set to True, then a new transaction is started immediately after a transaction is committed. Otherwise, no new transaction is created.
After a transaction ends, the full functionality of a Recordset may be preserved, or the Recordordset may become unusable. For DDM data sources, the recordset is always usable after committing or rolling back a transaction. For ADO data sources this behaviour depends upon the OLE DB provider. The advanced view in the Recordset tab of the Database Description dialog shows the behaviour for a particular Recordset. If Preserve on Abort is set to True, then the Recordset is usable after rolling back a transaction. If Preserve on Commit is set to True, then the Recordset is usable after committing a transaction. Otherwise, the Recordset is unusable after a transaction ends and should be closed.
DBConnect Method | Open Method | Disconnect Method | Close Method | Find Method | Move Method | AddNew Method | BeginTrans Method | CancelUpdate Method | CommitTrans Method |Delete Method | RollbackTrans Method | Seek Method | Update Method | ConnectionString property | Connection object
© 2004-2021 looksoftware. All rights reserved.