From wiki.ginstr.com
Revision as of 09:33, 9 November 2017 by Bojan (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

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 or gn:act_rawUpdateValues actions are stored into transactions set it will execute those actions in a single transaction and return true, otherwise it will return false. 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_rawWrite

0 rows in table reports

after action execution of gn:act_stopTransactionMode and entering into true block

2 rows in table reports