Zeos and locking

Forum related to MySQL

Moderators: gto, cipto_kh, EgonHugeist

Post Reply
marcocot
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 23.05.2007, 13:52

Zeos and locking

Post by marcocot »

Hello,
I feel a little confusing about the functionality of transaction isolation and locking.Hoping someone can help me.

Lets suppose 2 transactions work on the same record I call them T1,T2. T1 start transaction before T2. T2 commit before T1 here what I got:

Serializable, I got dead lock error on T1;

Repeatableread and Read Committed I got no error and the last commit effects the record.

Apart from the first case, isolation level does not manage the lock of the
record. So assume that isolation level does not manage locking. How can I menage locking on row level? Shold I use SELECT ... FOR UPDATE or
SELECT... or SELECT ...LOCK IN SHARE MODE?

Thanks
Marco
marcocot
Fresh Boarder
Fresh Boarder
Posts: 17
Joined: 23.05.2007, 13:52

Re: Zeos and locking

Post by marcocot »

marcocot wrote:Hello,
I feel a little confusing about the functionality of transaction isolation and locking.Hoping someone can help me.

Lets suppose 2 transactions work on the same record I call them T1,T2. T1 start transaction before T2. T2 commit before T1 here what I got:

Serializable, I got dead lock error on T1;

Repeatableread and Read Committed I got no error and the last commit effects the record.

Apart from the first case, isolation level does not manage the lock of the
record. So assume that isolation level does not manage locking. How can I menage locking on row level? Shold I use SELECT ... FOR UPDATE or
SELECT... or SELECT ...LOCK IN SHARE MODE?

Thanks
Marco
Maybe my post is not so clear... Someone can tell me how to menage row lock?
Post Reply