DatastoreTransaction¶
- class lsst.daf.butler.datastore.DatastoreTransaction(parent: DatastoreTransaction | None = None)¶
- Bases: - object- Keeps a log of - Datastoreactivity and allow rollback.- Parameters:
- parentDatastoreTransaction, optional
- The parent transaction (if any). 
 
- parent
 - Methods Summary - commit()- Commit this transaction. - registerUndo(name, undoFunc, *args, **kwargs)- Register event with undo function. - rollback()- Roll back all events in this transaction. - undoWith(name, undoFunc, *args, **kwargs)- Register undo function if nested operation succeeds. - Methods Documentation - registerUndo(name: str, undoFunc: Callable, *args: Any, **kwargs: Any) None¶
- Register event with undo function. 
 - undoWith(name: str, undoFunc: Callable, *args: Any, **kwargs: Any) Iterator[None]¶
- Register undo function if nested operation succeeds. - Calls - registerUndo.- This can be used to wrap individual undo-able statements within a DatastoreTransaction block. Multiple statements that can fail separately should not be part of the same - undoWithblock.- All arguments are forwarded directly to - registerUndo.- Parameters:
- namestr
- The name to associate with this event. 
- undoFuncCallable
- Function to undo this event. 
- *argstuple
- Positional arguments for - undoFunc.
- **kwargstyping.Any
- Keyword arguments for - undoFunc.
 
- name