cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
228
Views
0
Helpful
3
Replies
khgrant
Cisco Employee

CDB lock

 

Hello experts,

 

 

I have a quick question.

 

 

My customer is using NCS version 3.4.3.

 

 

When two transactions (service creation, service modification) occur

 

and  there is no relationship between two transactions,

 

does one transaction wait for the other’s CDB lock to be over?

 

 

Or is there partial CDB lock and  doesn’t one transaction have to wait for the other’s CDB lock?

 

 

Your comment would be really appreciated.

 

 

Thanks,

 

Taketoshi

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
khgrant
Cisco Employee

 

Hey Taketoshi,

 

 

It is important to note that CDB is locked for writing during a read session. A

 

session starts with CdbSession Cdb.startSession() and the lock is not released until the

 

CdbSession.endSession() (or the Cdb.close()) call. CDB will also automatically release the

 

lock if the socket is closed for some other reason, such as program termination.

 

Also the CDB_LOCK_REQUEST  can be used to lock the CDB for any transaction .

 

 

But Partial lock option is also there in CDB.

 

 

If the CDB_LOCK_PARTIAL flag is used together with CDB_LOCK_REQUEST, the "subscription lock" only applies to the smallest data subtree that includes all the data in the write request. This means that multiple writes that generates subscription notifications, and  delivery of the corresponding notifications, can proceed in parallel as long as they affect disjunct parts of the data tree.

 

 

I hope that helps..

 

View solution in original post

3 REPLIES 3
khgrant
Cisco Employee

 

Hey Taketoshi,

 

 

It is important to note that CDB is locked for writing during a read session. A

 

session starts with CdbSession Cdb.startSession() and the lock is not released until the

 

CdbSession.endSession() (or the Cdb.close()) call. CDB will also automatically release the

 

lock if the socket is closed for some other reason, such as program termination.

 

Also the CDB_LOCK_REQUEST  can be used to lock the CDB for any transaction .

 

 

But Partial lock option is also there in CDB.

 

 

If the CDB_LOCK_PARTIAL flag is used together with CDB_LOCK_REQUEST, the "subscription lock" only applies to the smallest data subtree that includes all the data in the write request. This means that multiple writes that generates subscription notifications, and  delivery of the corresponding notifications, can proceed in parallel as long as they affect disjunct parts of the data tree.

 

 

I hope that helps..

 

View solution in original post

 

Is there a good document that explains the CDB lock vs. transaction semantics?

 

 

I find myself struggling with exactly when different types of locks are required (vs. how parallel requests are handled in the GUI vs. via the API), and how the transaction manager proceeds during service creation – how it secures a partial lock against just the devices in the scope of the current transactions, and then how that lock is managed by the subscription handlers.

 

 

I know there is a little about this in the operations course/manual, but that doesn't seem to quite paint the whole picture.

 

 

Thanks,

 

Mark

 

Hi khgrant

Did you get a good doc for cdb-lock ?

Thanks

Hao Huang

Content for Community-Ad