Subject Re: [firebird-support] The difference in queries
Author Łukasz Bączek
Hi,

Ok
, but the first question is in SERIALIZABLE transactions and therefore, according to this:
http://www.firebirdsql.org/manual/isql-transactions.html


is blocked because the query in a transaction with SERIALIZABLE isolation are blocked automatically, so what's the difference?

Regards


W dniu 10.03.2014 06:13, liviuslivius@... pisze:
 

Hi,

In first query you have no lock. In second you have lock on selected records. First query can be run by different users without any lock. After select from second query user acuire lock on selected records

Regards,
Karol Bieniaszewski

----- Reply message -----
Od: "Łukasz Bączek" <baczeklu@...>
Do: <firebird-support@yahoogroups.com>
Temat: [firebird-support] The difference in queries
Data: niedz., mar 9, 2014 21:33


 

Hi,

Inquiries made ​​at isolation level SERIALIZABLE are automatically blocked
So, for example, by performing a SQL query :

"SELECT * FROM (SELECT sesje.id_sesje , sesje.numer , sesje.data ,
sesje.rozpatrzona , osoby.imie | | ' ' | | osoby.nazwisko chairman AS
FROM LEFT JOIN sessions sesje_eksperci ON sesje.id_sesje =
sesje_eksperci.id_sesje AND sesje_eksperci.przewodniczacy = 1 LEFT JOIN
person ON osoby.id_osoby = sesje_eksperci.id_osoby sesje.data ORDER BY
ASC) WHERE sessions id_sesje = 12 "

I have done automatically blockade record , right?

So what will be different query:

"SELECT * FROM (SELECT sesje.id_sesje , sesje.numer , sesje.data ,
sesje.rozpatrzona , osoby.imie | | ' ' | | osoby.nazwisko chairman AS
FROM LEFT JOIN sessions sesje_eksperci ON sesje.id_sesje =
sesje_eksperci.id_sesje AND sesje_eksperci.przewodniczacy = 1 LEFT JOIN
person ON osoby.id_osoby = sesje_eksperci.id_osoby sesje.data ORDER BY
ASC) WHERE sessions id_sesje = 12 FOR UPDATE WITH LOCK "

because both query blocks record .

Regards