Description
\"1) Get information of the current transaction status of an instance. 1a) The current transaction number $TRANSNUMBER(
Use Case
\"1a) v_TR=$transnumber(v_INST) , v_TR= the transaction number to which v_INST is assigned 1b) NEWINSTANCE \"\"C1\"\",v_INST1 NEWINSTANCE \"\"C2\"\",v_INST2,\"\"TRANSACTION=T\"\" , C1 will open table/entity TAB11 and TAB12 (on DEF) , C2 will open path $MY_PATH and table/entity TAB21 putmess $transproperties(0,\"\"TRANS_LST\"\") , \"\"1·,2\"\" putmess $transproperties(0,\"\"INSTANCE_LST\"\") , v_INST1·,v_INST2 putmess $transproperties(1,\"\"INSTANCE_LST\"\") , v_INST1 putmess $transproperties(2,\"\"INSTANCE_LST\"\") , v_INST2 putmess $transproperties(1,\"\"PATH_LST\"\") , \"\"_DEF#1\"\" putmess $transproperties(1,\"\"TABLE_LST\"\") , \"\"_DEF#1:TAB11·,_DEF#1:TAB12\"\" putmess $transproperties(2,\"\"PATH_LST\"\") , \"\"_MY_PATH#2\"\" putmess $transproperties(2,\"\"TABLE_LST\"\") , \"\"_MY_PATH#2:TAB21\"\" 1c) (assumption as 1b) putmess $PATHPROPERTIES(\"\"DEF#1\"\",\"\"NAME\"\") , \"\"DEF\"\" putmess $PATHPROPERTIES(\"\"DEF#1\"\",\"\"TRANSENUMBER\"\") , 1 putmess $PATHPROPERTIES(\"\"DEF#1\"\",\"\"TABLE_LST\"\") , \"\"_DEF#1:TAB11·,_DEF#1:TAB12\"\" putmess $PATHPROPERTIES(\"\"MY_PATH#1\"\",\"\"NAME\"\") , \"\"MY_PATH\"\" putmess $PATHPROPERTIES(\"\"MY_PATH#1\"\",\"\"TRANSENUMBER\"\") , 2 putmess $PATHPROPERTIES(\"\"MY_PATH#1\"\",\"\"TABLE_LST\"\") , \"\"_MY_PATH#2:TAB21\"\" 1d) (assumption as 1b) putmess $TABLEPROPERTIES(\"\"DEF#1:TAB11\"\",\"\"NAME\"\") , \"\"TAB11\"\" putmess $TABLEPROPERTIES(\"\"DEF#1:TAB11\"\",\"\"MODELL\"\") , \"\"A_MODELL\"\" putmess $TABLEPROPERTIES(\"\"DEF#1:TAB11\"\",\"\"PATHINST\"\") , \"\"_DEF#1\"\" putmess $TABLEPROPERTIES(\"\"DEF#1:TAB12\"\",\"\"NAME\"\") , \"\"TAB12\"\" putmess $TABLEPROPERTIES(\"\"DEF#1:TAB12\"\",\"\"MODELL\"\") , \"\"A_MODELL\"\" putmess $TABLEPROPERTIES(\"\"DEF#1:TAB12\"\",\"\"PATHINST\"\") , \"\"_DEF#1\"\" putmess $TABLEPROPERTIES(\"\"MY_PATH#2:TAB11\"\",\"\"NAME\"\") , \"\"TAB21\"\" putmess $TABLEPROPERTIES(\"\"MY_PATH#2:TAB11\"\",\"\"MODELL\"\") , \"\"A_MODELL\"\" putmess $TABLEPROPERTIES(\"\"MY_PATH#2:TAB11\"\",\"\"PATHINST\"\") , \"\"_MY_PATH#2\"\" 2) NEWINSTANCE \"\"C1\"\",v_INST1 v_TR1=$transnumber(v_INST1) , v_TR1=1 (default transaction) NEWINSTANCE \"\"C2\"\",v_INST2,\"\"TRANSACTION=T\"\" v_TR2=$transnumber(v_INST2) , v_TR1=2 NEWINSTANCE \"\"C3\"\",v_INST3,\"\"TRANSNUMBER=%%v_TR1\"\" v_TR3=$transnumber(v_INST3) , v_TR3=1 NEWINSTANCE \"\"C4\"\",v_INST4,\"\"TRANSNUMBER=%%v_TR2\"\" v_TR4=$transnumber(v_INST4) , v_TR4=2\"
Importance
First: It\'s allways good to knew, what\'s going on in an application. Think about debugging or error reporting Second: You have to minimze open connections to the database. This can have to reasons a) licence politics of database vendor b) (dead) locking issues. Every time NEWINSTANCE with TRANSACTION=T will open a new connetion to the database. From database side this conections all all independend and will block each other when lock a row. If it is nescassary to have more then one transaction it is not easy to determine if one have to open a new transaction or reuse teh curren t E.g: component C1 runs on trans #2 and use a common table component C2 runs on trans #3 as it have to commit/rollback independ of C1 C2 will start a component C3 to get and set further information. This transaction C3 have to be run in the environment of transaction #2 as it also use this common table C3 is independed of C1 and both components could be started and stopped every time How to archiev this?
Type
Scripting/Coding
Operating System
Not Applicable
Status
Open