1 |
|
2010-09-16 Bernhard Herzog <[email protected]> |
2 |
|
|
3 |
|
Avoid database deadlocks that can happen when database clients try |
4 |
|
to work with the same case using two separate database |
5 |
|
connections. See mpuls/issue1145 for details. |
6 |
|
|
7 |
|
* formed/formed/plugins/export/rg_sql.py (SQL_TEMPLATE): Split the |
8 |
|
computation of the new json structure description into the new |
9 |
|
database function compute_case_structure |
10 |
|
(TRIGGER_TMPL): Change the trigger functions to immediately update |
11 |
|
the cached json structure description instead of just setting the |
12 |
|
modified flag. This avoids the lazy recomputation that makes what |
13 |
|
seems like a read-only access (calling get_case_structure) into a |
14 |
|
writing access (updates of the cache). The writes lock the row in |
15 |
|
the case_structure table which prevent other connections from |
16 |
|
accessing the same case. As part of this, the delete triggers are |
17 |
|
now AFTER triggers because the repeat groups instance must have |
18 |
|
been removed when the structure is recomputed. |
19 |
|
(SUBSELECT_TMPL): Since the delete trigger is now an after |
20 |
|
trigger, we need to change the way the master id is computed. We |
21 |
|
cannot join with the repeatgroup table in question because the row |
22 |
|
has already been deleted. However, we can use the master_id |
23 |
|
column of the OLD row to select the row of the parent table. |
24 |
|
(create_triggers): Avoid the inner joins with the current repeat |
25 |
|
group for the above mentioned reasons. In the very common case of |
26 |
|
repeat groups which are direct children of the master_tbl, we can |
27 |
|
compare the master_tbl.id directly with the row's master_id. |
28 |
|
|
29 |
2010-09-14 Roland Geider <[email protected]> |
2010-09-14 Roland Geider <[email protected]> |
30 |
|
|
31 |
* formed/formed/plugins/export/xsd.py: issue1131: update XSD for new |
* formed/formed/plugins/export/xsd.py: issue1131: update XSD for new |