#include <mozStorageHelper.h>
Note that nested transactions are not supported by sqlite, so if a transaction is already in progress, this object does nothing. Note that in this case, you may not get the transaction type you ask for, and you won't be able to rollback.
Public Member Functions | |
| mozStorageTransaction (mozIStorageConnection *aConnection, PRBool aCommitOnComplete, PRInt32 aType=mozIStorageConnection::TRANSACTION_DEFERRED) | |
| ~mozStorageTransaction () | |
| nsresult | Commit () |
| Commits the transaction if one is in progress. | |
| nsresult | Rollback () |
| Rolls back the transaction in progress. | |
| PRBool | HasTransaction () |
| Returns whether this object wraps a real transaction. | |
| void | SetDefaultAction (PRBool aCommitOnComplete) |
| This sets the default action (commit or rollback) when this object goes out of scope. | |
Protected Attributes | |
| nsCOMPtr< mozIStorageConnection > | mConnection |
| PRBool | mHasTransaction |
| PRBool | mCommitOnComplete |
| PRBool | mCompleted |
| mozStorageTransaction::mozStorageTransaction | ( | mozIStorageConnection * | aConnection, | |
| PRBool | aCommitOnComplete, | |||
| PRInt32 | aType = mozIStorageConnection::TRANSACTION_DEFERRED | |||
| ) | [inline] |
| mozStorageTransaction::~mozStorageTransaction | ( | ) | [inline] |
| nsresult mozStorageTransaction::Commit | ( | ) | [inline] |
If one is not in progress, this is a NOP since the actual owner of the transaction outside of our scope is in charge of finally comitting or rolling back the transaction.
| nsresult mozStorageTransaction::Rollback | ( | ) | [inline] |
You should only call this function if this object has a real transaction (HasTransaction() = true) because otherwise, there is no transaction to roll back.
| PRBool mozStorageTransaction::HasTransaction | ( | ) | [inline] |
False means that this object doesn't do anything because there was already a transaction in progress when it was created.
| void mozStorageTransaction::SetDefaultAction | ( | PRBool | aCommitOnComplete | ) | [inline] |
nsCOMPtr<mozIStorageConnection> mozStorageTransaction::mConnection [protected] |
PRBool mozStorageTransaction::mHasTransaction [protected] |
PRBool mozStorageTransaction::mCommitOnComplete [protected] |
PRBool mozStorageTransaction::mCompleted [protected] |
1.5.6