Sophie

Sophie

distrib > Mandriva > 2008.1 > x86_64 > by-pkgid > 05cd670d8a02b2b4a0ffb1756f2e8308 > files > 9471

php-manual-zh-5.2.4-1mdv2008.1.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML
><HEAD
><TITLE
>SDO_DAS_Relational::applyChanges</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK
REL="HOME"
TITLE="PHP 手册"
HREF="index.html"><LINK
REL="UP"
TITLE="SDO Relational Data Access Service Functions"
HREF="ref.sdo.das.rel.html"><LINK
REL="PREVIOUS"
TITLE="SDO Relational Data Access Service Functions"
HREF="ref.sdo.das.rel.html"><LINK
REL="NEXT"
TITLE="SDO_DAS_Relational::__construct"
HREF="function.sdo-das-relational-construct.html"><META
HTTP-EQUIV="Content-type"
CONTENT="text/html; charset=UTF-8"></HEAD
><BODY
CLASS="refentry"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
SUMMARY="Header navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>PHP 手册</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="ref.sdo.das.rel.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
></TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="function.sdo-das-relational-construct.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><H1
><A
NAME="function.SDO-DAS-Relational-applyChanges"
></A
>SDO_DAS_Relational::applyChanges</H1
><DIV
CLASS="refnamediv"
><A
NAME="AEN205092"
></A
><P
>    (no version information, might be only in CVS)</P
>SDO_DAS_Relational::applyChanges&nbsp;--&nbsp;
	    Applies the changes made to a data graph back to the database.
  </DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN205095"
></A
><H2
>说明</H2
>void <B
CLASS="methodname"
>SDO_DAS_Relational::applyChanges</B
> ( PDO database_handle, SDODataObject root_data_object )<BR
></BR
><DIV
CLASS="warning"
><P
></P
><TABLE
CLASS="warning"
BORDER="1"
WIDTH="100%"
><TR
><TD
ALIGN="CENTER"
><B
>警告</B
></TD
></TR
><TR
><TD
ALIGN="LEFT"
><P
>本函数是<SPAN
CLASS="emphasis"
><I
CLASS="emphasis"
>实验性</I
></SPAN
>的。本函数的行为,包括函数名称以及其它任何关于本函数的文档可能会在没有通知的情况下随
PHP 以后的发布而改变。使用本函数风险自担。</P
></TD
></TR
></TABLE
></DIV
><P
>&#13;   Given a PDO database handle and the special root object of a data graph, 
   examine the change summary in the datagraph and applies the changes 
   to the database.
   The changes that it can apply can be creations of data objects, 
   deletes of data objects, and modifications to properties of data objects.
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN205110"
></A
><H2
>参数</H2
><P
>&#13;   <P
></P
><DIV
CLASS="variablelist"
><DL
><DT
>PDO_database_handle</DT
><DD
><P
>&#13;       Constructed using the PDO extension. 
       A typical line to construct a PDO database handle might look like this:
       <TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
CELLPADDING="5"
><TR
><TD
><code><font color="#000000">
$dbh = new PDO("mysql:dbname=COMPANYDB;host=localhost",DATABASE_USER,DATABASE_PASSWORD);</font>
</code></TD
></TR
></TABLE
>
      </P
></DD
><DT
>root_data_object</DT
><DD
><P
>&#13;       The special root object which is at the top of every SDO data graph.
      </P
></DD
></DL
></DIV
>
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN205123"
></A
><H2
>返回值</H2
><P
>&#13;   None.
   Note however that the datagraph that was passed is still intact and usable.
   Furthermore, if data objects were created and written back to a 
   table with autogenerated primary keys, 
   then those primary keys will now be set in the data objects.
   If the changes were successfully written, 
   then the change summary associated with the datagraph will 
   have been cleared, 
   so that it is possible to now make further changes to the 
   data graph and apply those changes in turn.
   In this way it is possible to work with the same data graph 
   and apply changes repeatedly.
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN205126"
></A
><H2
>错误/异常</H2
><P
>&#13;   <B
CLASS="function"
>SDO_DAS_Relational::applyChanges()</B
>
   can throw an SDO_DAS_Relational_Exception if it is 
   unable to apply all the changes correctly.
  </P
><P
>&#13;   The Relational DAS starts a database transaction before 
   beginning to apply the changes and will commit 
   the transaction only if they are all successful.
   The Relational DAS generates qualified update and delete statements 
   which contain a where clause that specifies that the row to be 
   updated or deleted must contain the same values that it did 
   when the data was first retrieved.
   This is how the the optimistic concurrency is implemented.
   If any of the qualified update or delete statements fails to update or 
   delete their target row, it may be because the data has been altered 
   in the database in the meantime.
   In any event, if any update fails for any reason, 
   the transaction is rolled back and an exception thrown.
   The exception will contain the generated SQL statement that failed.
  </P
><P
>&#13;   The Relational DAS also catches any PDO exceptions and obtains PDO 
   diagnostic information which it includes in an 
   SDO_DAS_Relational_Exception which it then throws.
  </P
></DIV
><DIV
CLASS="refsect1"
><A
NAME="AEN205132"
></A
><H2
>范例</H2
><P
>&#13;   Please see the
   <A
HREF="ref.sdo.das.rel.html#sdo.das.rel.examples"
>Examples</A
>
   section in the general information about the Relational DAS
   for many examples of calling this method.
   Please see also the section on
   <A
HREF="ref.sdo.das.rel.html#sdo.das.rel.tracing"
>Tracing</A
>
   to see how you can see what SQL statements are 
   generated by the Relational DAS.
  </P
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
SUMMARY="Footer navigation table"
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="ref.sdo.das.rel.html"
ACCESSKEY="P"
>上一页</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
ACCESSKEY="H"
>起始页</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="function.sdo-das-relational-construct.html"
ACCESSKEY="N"
>下一页</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>SDO Relational Data Access Service Functions</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="ref.sdo.das.rel.html"
ACCESSKEY="U"
>上一级</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>SDO_DAS_Relational::__construct</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>