Issue 577: Which model should ConcurrencyControl support? (concurrency) Source: (, ) Nature: Uncategorized Severity: Summary: Summary: There is inconsistency regarding which model ConcurrencyControl needs to support Resolution: Revised Text: Actions taken: May 20, 1997: received issue Discussion: End of Annotations:===== Return-Path: From: KENJI.KUSHI@soft23.soft.soft.hitachi.co.jp Message-Type: Multiple Part Subject: CosConcurrency questions To: concurrency@omg.org Sender: KENJI.KUSHI@soft23.soft.soft.hitachi.co.jp Date: Tue, 20 May 97 18:26:02 +0900 Content-Identifier: X Priority: normal Importance: normal X400-Received: by /C=JP/ADMD=HITNET/PRMD=HITACHI/; deferred until Tue, 20 May 97 18:26:02 +0900; Relayed; Tue, 20 May 97 18:26:02 +0900 X400-Mts-Identifier: [/C=JP/ADMD=HITNET/PRMD=HITACHI/;SOFT23970520183434CZU] X400-Originator: KENJI.KUSHI@soft23.soft.soft.hitachi.co.jp X400-Recipients: concurrency@omg.org X400-Content-Type: (22) Regarding the CosConcurrency specification(Feb 12 97), I have three questions. 2. Which model should ConcurrencyControl support ? There is inconsistency regarding which model ConcurrencyControl need to support. Section 7.4 describes two models "Multiple Possession semantics" and "Other approaches to nested transactions". In "Other approaches to nested transactions" description, it says "The ConcurrencyControlService performs these lock transfers automatically". Section 7.2.2 says that "The Concurrency Control Service interface supports a locking model called multiple possession semantics." It seems to me section 7.4 and 7.2.2 is inconsistent and Which model ConcurrencyControl should support is not clear. >>> 2. Multiple posession model is used. I believe it's mentioning nested >>> transaction because transaction service can implement nested transaction >>> as an optional feature. > ? >>I think that section 7.4 of the spec is ambiguous. >>Below is a simple nested example. > > { > Current::begin(); > LockSet ls=LockSetFactory::create(); // implicit mode creation > Current::begin(); // nested trans begin > ls->lock(lock_mode::read); > Current::commit(); // read lock passed to parent transaction (lock transfer) > ls->lock(lock_mode::read); // multiple possession model, OK > ls->lock(lock_mode::read); // another time, still OK > Current::commit(); // read locks dropped > } > >>{ >>: >>CosTransactions::begin(); >> TransactionalLockSet ls=LockSetFactory::create_transactional(); >> >> CosTransactions::begin(); >> ls->lock(); >> CosTransactions::commit(); >> >> ls->unlock() ; //(a) >> >>CosTransactions::commit(); >>: >>} >> >>Does the unlock operation (a) throw LockNotHeld? The spec 7.4 say >>"The Concurrency Control service performs these lock transfers automatically". >>This satements suggests suceeding of unlock? Otherwise, spec also says >>"A transaction cannot drop a lock that it did not acquire itself". >>In this case, it suggests unlock failure? > > Section 7.4 mentions about interactions of the multiple posession model > and nested transaction. Implementation wise, transactional lock set > knows if a lock request is done under nested transaction. The nested > transaction lock requests are held in a different lock baskets, if the > nested transaction commits, the nested transaction lock baskets are integrated > with parent transaction's lock baskets. Otherwise the nested transaction > lock baskets are unlocked. > > In your example, as you are using transactions, you do not have to call > ls->unlock(mode). Upon transaction completion, the appropriate locks are > dropped automatically. > > In 7.5.5, there does appear to be some problem with signature of > create_transactional(). It might be more consistent with the description > by changing it to TransactionalLockSet create_transactional(CosTransactions:: > Coordinator which). Some one may have proposed it already. Ask people > around for information. > > LockSet is used for implicit mode transactions, and non transactions. > TransactionalLockSet is used for explicit mode transactions. > >>Best Regards, >>Kenji Kushi > > -Thomas Wang (Software Engineer, Internet Technology Lab) > wang@cup.hp.com http://www.concentric.net/~ttwang >