Transactions offer your application's data protection from application or system failures. That is, Figaro transactions offer your application full ACID support:
Atomicity
Multiple container operations are treated as a single unit of work. Once committed, all write operations performed under the protection of the transaction are saved to your containers. Further, in the event that you abort a transaction, all write operations performed during the transaction are discarded. In this event, your container is left in the state it was in before the transaction began, regardless of the number or type of write operations you may have performed during the course of the transaction.
|
Figaro transactions can span one or more container handles. Also, transactions can span both containers and Berkeley DB databases, provided they exist within the same environment. |
Consistency
Your containers will never see a partially completed transaction. This is true even if your application fails while there are in-progress transactions. If the application or system fails, then either all of the container changes appear when the application next runs, or none of them appear.
In other words, whatever consistency requirements your application has will never be violated by Figaro. If, for example, your application requires every record to include an employee ID, and your code faithfully adds that ID to its container records, then Figaro will never violate that consistency requirement. The ID will remain in the container records until such a time as your application chooses to delete it.
Isolation
While a transaction is in progress, your containers will appear to the transaction as if there are no other operations occurring outside of the transaction. That is, operations wrapped inside a transaction will always have a clean and consistent view of your databases. They never have to see updates currently in progress under the protection of another transa ction. Note, however, that isolation guarantees can be relaxed from the default setting. See Isolation for more information.