⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cwp4300.htm

📁 Perst开源实时数据库
💻 HTM
字号:
<!-- saved from url=(0007)http:// -->
<HTML><HEAD><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><TITLE>Perst.Storage.BeginThreadTransaction</TITLE><LINK REL=STYLESHEET HREF="../CommentReport.css" TYPE="text/css"></HEAD><BODY topmargin=0 rightmargin=0 leftmargin=0 style="background-image: url(../titletile.jpg); background-repeat:repeat-x; background-position: 0 0;" ><DIV CLASS="PageHeading">Perst.Storage.BeginThreadTransaction Function</DIV><DIV CLASS="Description">
Begin per-thread transaction. Three types of per-thread transactions are supported: 
exclusive, cooperative and serializable. In case of exclusive transaction, only one 
thread can update the database. In cooperative mode, multiple transaction can work 
concurrently and commit() method will be invoked only when transactions of all threads
are terminated. Serializable transactions can also work concurrently. But unlike
cooperative transaction, the threads are isolated from each other. Each thread
has its own associated set of modified objects and committing the transaction will cause
saving only of these objects to the database.To synchronize access to the objects
in case of serializable transaction programmer should use lock methods
of IResource interface. Shared lock should be set before read access to any object, 
and exclusive lock - before write access. Locks will be automatically released when
transaction is committed (so programmer should not explicitly invoke unlock method)
In this case it is guaranteed that transactions are serializable.
It is not possible to use <code>IPersistent.store()</code> method in
serializable transactions. That is why it is also not possible to use Index and FieldIndex
containers (since them are based on B-Tree and B-Tree directly access database pages
and use <code>store()</code> method to assign OID to inserted object. 
You should use <code>SortedCollection</code> based on T-Tree instead or alternative
B-Tree implemenataion (set "perst.alternative.btree" property).
<P></DIV><IMG src="../GradLeft.jpg" width=7 height=378 alt="" border="0" style="position:absolute; left:10; top:18;z-Index:2"><IMG src="../GradTop.jpg" width=352 height=7 alt="" border="0" align="top" style="position:absolute; left:10; top:18; z-index:1"><DIV CLASS="Remarks"><SPAN CLASS="RemarkHdrX">Public void BeginThreadTransaction (Perst.TransactionMode)</SPAN></DIV><TABLE CLASS="InfoTable" cellpadding=0 cellspacing=0><TR height=20><TD width=20>&nbsp;</TD><TD valign=top align=left width=9 bgcolor="#cccc66"><IMG SRC="../graycorner.jpg" align=top></TD><TD CLASS="TableLightLabel" >Type</TD><TD CLASS="TableLightLabel" >Name</TD><TD CLASS="TableLightLabel" >Description</TD><TD width=20>&nbsp;</TD></TR><TR height=20><TD width=20>&nbsp;</TD><TD CLASS="TableLightDesc">&nbsp;</TD><TD CLASS="TableLightDesc"><A HREF="CWP2371.HTM">TransactionMode</A></TD><TD CLASS="TableLightDesc">mode</TD><TD CLASS="TableLightDesc"><code>TransactionMode.Exclusive</code>,  <code>TransactionMode.Cooperative</code>,
<code>TransactionMode.ReplicationSlave</code> or <code>TransactionMode.Serializable</code>
</TD><TD width=20>&nbsp;</TD></TR></TABLE><TABLE CLASS="InfoTable" cellpadding=0 cellspacing=0><TR height=20><TD width=20>&nbsp;</TD><TD valign=top align=left width=9 bgcolor="#cccc66"><IMG SRC="../graycorner.jpg" align=top></TD><TD CLASS="TableLightLabel" WIDTH=206>Return</TD><TD CLASS="TableLightLabel" >Description</TD><TD width=20>&nbsp;</TD></TR><TR height=20><TD width=20>&nbsp;</TD><TD CLASS="TableLightDesc">&nbsp;</TD><TD CLASS="TableLightDesc">void</TD><TD CLASS="TableLightDesc">&nbsp;</TD><TD width=20>&nbsp;</TD></TR></TABLE></BODY></HTML>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -