MentDB, The digital brain.  About me Home
Back / All functions / Transaction

Whenever you run MQL commands, you are in a micro transaction.
If one of your orders returns an error, all your micro transaction is rollbacked.
The storage system is ACID.

commitrollbacktransaction logs

commit

Description

    To commit the current transaction

admin
word create duck en;
commit;
word create rabbit en;
exception (1) ("here a rollback ...");
mentdb
1: here a rollback ...
admin
node show W[duck]
mentdb
{
"fl": {
"en": {
"ltl": "TH[77]",
"ftl": "TH[77]"
}
},
"w": 1,
"k": "W[duck]"
}
admin
node show W[rabbit]
mentdb
Sorry, the node 'W[rabbit]' does not exist.

rollback

Description

    To rollback the current transaction

admin
word create wolf en;
commit;
word create panda en;
rollback;
mentdb
Rollback done.
admin
node show W[wolf]
mentdb
{
"fl": {
"en": {
"ltl": "TH[78]",
"ftl": "TH[78]"
}
},
"w": 1,
"k": "W[wolf]"
}
admin
node show W[panda]
mentdb
Sorry, the node 'W[panda]' does not exist.

transaction logs <limit>

Description

    To show the log block list to replay

Parameters

    limit:   The limit value - integer >= 0 - required
admin
word create hippo en;
env set var "[transaction_logs]" (transaction logs 10;);
[transaction_logs]
mentdb
[
"1\tTO_OVERWRITE_COUNTER_INDEX\tIndexFileId:651\tCounter:4",
"2\tTO_SET_OLD_INDEX_BLOCK\tIndexFileId:651\tIndexPosition:104\tDataFileId:-1\tDataPosition:-1",
"3\tTO_DELETE_BLOCK\tDataFileId:0\tPosition:1589248",
"4\tTO_REWRITE_UNUSED\tDataFileId:0\tPosition:1589248",
"5\tTO_DELETE_BLOCK\tDataFileId:0\tPosition:1589504",
"6\tTO_REWRITE_UNUSED\tDataFileId:0\tPosition:1589504",
"7\tTO_OVERWRITE_COUNTER_INDEX\tIndexFileId:651\tCounter:5",
"8\tTO_SET_OLD_INDEX_BLOCK\tIndexFileId:651\tIndexPosition:104\tDataFileId:0\tDataPosition:1589504",
"9\tTO_DELETE_UNUSED\tDataFileId:0\tUnusedLength:8",
"10\tTO_REWRITE_BLOCK\tDataFileId:0\tPosition:1589504\tNextPosition:-1\tData:W1siV1toaXBwb10iLDAsMTU4OTI0OF1d \tSize:32"
]




© 2012-2017 - Jimmitry Payet.