(Created page with "<div style="float:right; clear:both; margin-left:0.5em;">__TOC__</div> <span STYLE="font-size: xx-large"><code>gn:act_stopTransactionMode</code></span> Category:Action_Libra...") |
m (formatting) |
||
Line 3: | Line 3: | ||
[[Category:Action_Library]] | [[Category:Action_Library]] | ||
− | ;Description: Action used to stop transaction mode of saving data to database. | + | ;Description: Action used to stop transaction mode of saving data to database. |
− | |||
+ | :When action is executed if transaction mode was enabled and <code>[[gn:act_rawWriteValues]]</code> or <code>[[gn:act_rawUpdateValues]]</code> actions are stored into transactions set, it will execute those actions in a single transaction and return <code>true</code>, otherwise it will return <code>false</code>. | ||
+ | |||
+ | :It will also return <code>false</code> if any of the actions from the set fails to execute during execution of transaction. | ||
+ | |||
+ | :In case any action fails during transaction all previously executed actions in same transaction will be rolled back. | ||
+ | |||
+ | :Pending transactions | ||
;Action returns: boolean | ;Action returns: boolean | ||
Line 15: | Line 21: | ||
=====initial database state===== | =====initial database state===== | ||
− | 0 rows in table reports | + | ::0 rows in table reports |
=====screen.xml===== | =====screen.xml===== | ||
Line 34: | Line 40: | ||
</syntaxhighlight> | </syntaxhighlight> | ||
− | =====database state after action execution of second gn: | + | =====database state after action execution of second <code>[[gn:act_rawWriteValues]]</code> ===== |
− | 0 rows in table reports | + | ::0 rows in table reports |
− | =====after action execution of gn:act_stopTransactionMode and entering into true block===== | + | =====after action execution of <code>[[gn:act_stopTransactionMode]]</code> and entering into <code>true</code> block===== |
− | 2 rows in table reports | + | ::2 rows in table reports |
<hr> | <hr> |
Latest revision as of 18:21, 24 January 2018
gn:act_stopTransactionMode
- Description
- Action used to stop transaction mode of saving data to database.
- When action is executed if transaction mode was enabled and
gn:act_rawWriteValues
orgn:act_rawUpdateValues
actions are stored into transactions set, it will execute those actions in a single transaction and returntrue
, otherwise it will returnfalse
.
- It will also return
false
if any of the actions from the set fails to execute during execution of transaction.
- In case any action fails during transaction all previously executed actions in same transaction will be rolled back.
- Pending transactions
- Action returns
- boolean
Action signatures
[gn:act_stopTransactionMode]|[]
Example
initial database state
- 0 rows in table reports
screen.xml
<FrameLayout android:id="@+id/exampleFrame" android:layout_width="wrap_content" android:layout_height="wrap_content" android:visibility="gone" gn:act_set=" [gn:act_startTransactionMode]|[], [gn:act_rawWrite]|[reports;....], [gn:act_rawWrite]|[reports;....], [gn:act_if]|[[gn:act_stopTransactionMode]|[]-- [gn:act_toast]|[transaction success] :: [gn:act_toast]|[transaction failed]]" />
database state after action execution of second gn:act_rawWriteValues
- 0 rows in table reports
after action execution of gn:act_stopTransactionMode
and entering into true
block
- 2 rows in table reports