-
Notifications
You must be signed in to change notification settings - Fork 79
/
Copy pathlockshared.xml
106 lines (94 loc) · 3.31 KB
/
lockshared.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: ee52285714f7f7371364a3e5233d2ca2da078706 Maintainer: mumumu Status: ready -->
<refentry xml:id="mysql-xdevapi-collectionfind.lockshared" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>CollectionFind::lockShared</refname>
<refpurpose>SHARED LOCK 付きで操作を実行する</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<modifier>public</modifier> <type>mysql_xdevapi\CollectionFind</type><methodname>mysql_xdevapi\CollectionFind::lockShared</methodname>
<methodparam choice="opt"><type>int</type><parameter>lock_waiting_option</parameter></methodparam>
</methodsynopsis>
<para>
ロックを共有モードで使う複数のトランザクション間で、ドキュメントを共有することができます。
</para>
<para>
他のセッションからは行を読めますが、あなたがトランザクションをコミットするまで変更できません。
</para>
<para>
もしまだコミットしていない別のトランザクションから、これらの行が変更された場合、クエリは、トランザクションが終了し、最新の値を使うまで待たされます。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>lock_waiting_option</parameter></term>
<listitem>
<para>
オプションで指定できる、ロック待ちのオプション。
デフォルトは <constant>MYSQLX_LOCK_DEFAULT</constant> です。
有効な値は以下のとおりです:
</para>
<itemizedlist>
<listitem><para><constant>MYSQLX_LOCK_DEFAULT</constant></para></listitem>
<listitem><para><constant>MYSQLX_LOCK_NOWAIT</constant></para></listitem>
<listitem><para><constant>MYSQLX_LOCK_SKIP_LOCKED</constant></para></listitem>
</itemizedlist>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
後の処理で使える CollectionFind オブジェクトを返します。
</para>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<example>
<title><function>mysql_xdevapi\CollectionFind::lockShared</function> の例</title>
<programlisting role="php">
<![CDATA[
<?php
$session = mysql_xdevapi\getSession("mysqlx://user:password@localhost");
$schema = $session->getSchema("addressbook");
$collection = $schema->createCollection("people");
$session->startTransaction();
$result = $collection
->find("age > 50")
->lockShared()
->execute();
// ... read the object in shared mode
// Complete the transaction and unlock the document
$session->commit();
?>
]]>
</programlisting>
</example>
</refsect1>
</refentry>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->