MySQL Forums
Forum List  »  NDB clusters

NDB Transaction Row Lock
Posted by: ArunKumar N
Date: February 19, 2014 12:40PM

Hi Experts,

I would like to know how NDB API locks rows

1) If I am updating/deleting an row using NdbOperation will it hold a lock on the row or it will hold lock on the Primar Key

2) If I am updating or deleting an row NdbIndexOperation will it hold a lock on the row or it will hold lcok on the Index alone.

I have the schema following schema

Column-1 is PrimayKey
Column-2 is UniqueIndexed

I have tried the following scenario

1) Table has an row with column-1 = "A" column-2 = "1"
2) A Transaction-1 tries to delete a row using NdbIndexOperation i.e. with column-2 = 1, deletes but NOT COMMITS the transaction
3) Another Transaction-2 tries to Insert a row with column-1 = "B" column-2 = "1"

What I noticed is Transaction-2 is blocked until Transaction-1 commits.

So 1) what locks are held by Transaction-1
2) What locks are held by Transaction-2 and what locks it waits for


Can someone shed some light on this.

Thanks,
Arun

Options: ReplyQuote


Subject
Views
Written By
Posted
NDB Transaction Row Lock
2200
February 19, 2014 12:40PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.