office-gobmx/wizards/source/scriptforge
Jean-Pierre Ledure 9b5b313a2f ScriptForge (SF_Database) manage transactions
Transactions are managed by next UNO properties:
   XConnection.AutoCommit
   XConnection.TransactionIsolation
(They seem very easy to use but, in practice,
are not easy at all)

Usually all transactions are in auto-commit mode,
that means, a commit takes place after each
single SQL command.

Switching auto-commit off  means however that
the connection needs to be of type "ISOLATED"
and not of the default type "SHARED".

=> The usual shared connection must be closed.
   As a consequence, all rowsets/resultsets linked
   to the shared connection need to be closed as well.
=> Additionally the buffers must be emptied (flushed)
   to make committed data visible in the Base user
   interface.

All above aspects and constraints are managed in the
   database.SetTransactionMode(transactionmode)
   database.Commit()
   database.Rollback()
methods transparently for the user scripts.

The [transactionmode] argument has as value one of
the TransactionIsolation constants.
Without argument, database.SetTransactionMode()
restores the automatic mode.

The manual transaction mode is available for both
Basic and Python scripts.
Its implementation will require an update of the
documentation about the Database service.

Change-Id: I214bd91a1744d6d24609bc5efc987152c6e946c9
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/159867
Reviewed-by: Jean-Pierre Ledure <jp@ledure.be>
Tested-by: Jenkins
2023-11-24 09:54:59 +01:00
..
po
python ScriptForge (SF_Database) manage transactions 2023-11-24 09:54:59 +01:00
__License.xba
_CodingConventions.xba
_ModuleModel.xba
dialog.xlb
dlgConsole.xdl
dlgProgress.xdl
script.xlb
SF_Array.xba
SF_Dictionary.xba
SF_Exception.xba
SF_FileSystem.xba
SF_L10N.xba
SF_Platform.xba
SF_PythonHelper.xba
SF_Region.xba
SF_Root.xba
SF_Services.xba
SF_Session.xba
SF_String.xba
SF_TextStream.xba
SF_Timer.xba
SF_UI.xba
SF_Utils.xba