Page 1 of 1

Zeos and locking

Posted: 22.06.2007, 10:17
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

Re: Zeos and locking

Posted: 25.06.2007, 11:34
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?