From 200a40b332420f94992eb39a6d0ea1cf1490ffc4 Mon Sep 17 00:00:00 2001 From: coreyg Date: Fri, 21 Nov 2014 09:30:19 +0000 Subject: Adding tuscany's website to their svn repo for svnpubsub git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1640879 13f79535-47bb-0310-9956-ffa450edef68 --- .../rdb-das-cpp-optimisticconcurrencycontrol.html | 128 +++++++++++++++++++++ 1 file changed, 128 insertions(+) create mode 100644 site/trunk/site-publish/rdb-das-cpp-optimisticconcurrencycontrol.html (limited to 'site/trunk/site-publish/rdb-das-cpp-optimisticconcurrencycontrol.html') diff --git a/site/trunk/site-publish/rdb-das-cpp-optimisticconcurrencycontrol.html b/site/trunk/site-publish/rdb-das-cpp-optimisticconcurrencycontrol.html new file mode 100644 index 0000000000..f530979f31 --- /dev/null +++ b/site/trunk/site-publish/rdb-das-cpp-optimisticconcurrencycontrol.html @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + + Apache Tuscany : RDB DAS CPP - OptimisticConcurrencyControl + + + + + + + + + + + + + + + +
+ + + + +   + +
+ + +
+
+ + + + + + + + + +
+  Apache Tuscany > Home > DAS Overview > DAS C++ > DAS C++ Documentation Menu > RDB DAS C++ - User Guide > RDB DAS CPP - OptimisticConcurrencyControl + + User List | Dev List | Issue Tracker   +
+ + + + + + + +
+ + +
+ +
+
+

OptimisticConcurrencyControl

+ +

The RDB DAS is intended for use in disconnected scenarios. When the DAS returns a graph of SDO DataObjects as the result of a query, there are no locks held on the underlying database and the data is no longer associated with any database connection or transaction. However, although locks are not held, the DAS does employ a mechanism called Optimistic Concurrency Control (OCC) to manage concurrency.

+ +

Basically, when OCC is being utilized, the DAS checks whether the state of the database has changed since the original data was read before applying any writes to the same location. For example, suppose that a DAS client reads a set of Customers, modifies one Customer and then attempts to write the change back to the database:

+
+

CommandPtr select = das->createCommand("Select * from CUSTOMER where LASTNAME = 'Williams'");
+ DataObjectPtr root = select->executeQuery();

+ +

DataObjectPtr customer = root->getDataObject("CUSTOMER[1]");
+ customer->setCString("LASTNAME", "Pavick");

+ +

//Some period of time passes in which "CUSTOMER[1]" could be modified by another process or application

+ +

das->applyChanges(root);

+
+

If OCC is enabled then as part of "applyChanges" processing the DAS will ensure that the table row representing "CUSTOMER[1]" has not been changed since it was read. This is possible because a feature of the original SDO graph is to "remember" its original state along with any changes that have been made. The DAS has access to this original state and uses it to create an "overqualified" update statement. When the DAS executes this update statement against the database, it will fail if the underlying data has been modified (a collision has occurred) and, if so, an exception will be thrown and the transaction rolled back. If there is no collision then the update statement execution succeeds and the change is applied.

+
+
+
+ + +
+ + + + + + website stats + + + + + + -- cgit v1.2.3