source: cats/ISOcat/trunk/mod-ISOcat-access-data/access/lock.acc @ 2686

Last change on this file since 2686 was 2686, checked in by mwindhouwer, 11 years ago

Fixed the throtteling:

  • all SQL request go through the ISOcat.database throttle (settings in the ISOcat config), also the indirect DBX ones
  • big (more then 100 DCs) DCS to DCIF go through the big-dcif throttle (hardcoded settings)
File size: 1.8 KB
Line 
1<accessor debug="false">
2        <name>ISOcat.access.data.lock</name>
3        <descr>Get a lock.</descr>
4        <param mandatory="true">
5                <name>lock</name>
6                <descr>the lock id</descr>
7                <type canonical="true">string</type>
8        </param>
9        <param mandatory="true">
10                <name>register</name>
11                <descr>register the access</descr>
12                <type canonical="true">boolean</type>
13                <source>
14                        <param/>
15                        <nvp/>
16                        <default>
17                                <b>t</b>
18                        </default>
19                </source>
20        </param>
21        <idoc>
22                <instr>
23                        <type>isocat.sloot.dbx</type>
24                        <lock>var:lock</lock>
25                        <operator>ffcpl:/dbx/session-lock.xml</operator>
26                        <debug>var:accessor-debug</debug>
27                        <target>this:response</target>
28                </instr>
29                <if>
30                        <cond>
31                                <instr>
32                                        <type>copy</type>
33                                        <operand>var:register</operand>
34                                        <target>this:cond</target>
35                                </instr>
36                        </cond>
37                        <then>
38                                <!-- and now register this access -->
39                                <instr>
40                                        <type>sloot.xquery</type>
41                                        <operator>
42                                                <xquery>
43                                                        declare variable $lock as node() external;
44                                                       
45                                                        &lt;sql>
46                                                        UPDATE  generic_lock
47                                                        SET             last_access = ('now'::text)::timestamp with time zone
48                                                        WHERE   id = '{string($lock)}'
49                                                        ;
50                                                        &lt;/sql>
51                                                </xquery>
52                                        </operator>
53                                        <lock>var:lock</lock>
54                                        <target>var:sql</target>
55                                </instr>
56                                <accessor-debug>
57                                        <instr>
58                                                <type>copy</type>
59                                                <operand>var:sql</operand>
60                                                <target>ffcpl:/trace/lock.sql.xml</target>
61                                        </instr>
62                                </accessor-debug>
63                                <instr>
64                                        <type>isocat.sqlUpdate</type>
65                                        <operand>var:sql</operand>
66                                        <target>var:void</target>
67                                </instr>
68                        </then>
69                </if>
70        </idoc>
71        <exception>
72                <debug/>
73                <trace>ffcpl:/trace/lock.exception.xml</trace>
74                <throw/>
75        </exception>
76        <response>
77                <debug>ffcpl:/trace/lock.response.xml</debug>
78                <mime>application/xml</mime>
79                <expire>now</expire>
80        </response>
81</accessor>
Note: See TracBrowser for help on using the repository browser.