Subject | Firebird 2.5 - Snapshot isolation broken when executing stored procedure? |
---|---|
Author | Thomas Steinmaurer |
Post date | 2010-11-08T22:16:04Z |
Hello,
an interesting case with Firebird 2.5 here. Its the same across all
architectures (SS, CS, SC).
Two sessions via isql to the same database.
- Session 1 creates or alters a SP
set echo on;
SET TERM ^^ ;
CREATE OR ALTER PROCEDURE P_1 returns (
I Integer)
AS
begin
i = 9;
suspend;
end ^^
SET TERM ; ^^
commit;
- Session 2 executes
SQL> select * from p_1;
I
============
9
Which is correct. In the same session:
SQL> commit;
Starting a new transaction with snapshot isolation.
SQL> set transaction snapshot;
- Session 1 now alters the stored procedure to
set echo on;
SET TERM ^^ ;
CREATE OR ALTER PROCEDURE P_1 returns (
I Integer)
AS
begin
i = 10;
suspend;
end ^^
SET TERM ; ^^
commit;
- Transaction of session 2 is still running (in snapshot isolation). I
then execute another :
SQL> select * from p_1;
I
============
10
Which IMHO is wrong.
With Firebird 2.1, the last select * from p_1 gives me 9 as result,
which is IMHO correct, because I started a snapshot isolation
transaction *before* the CREATE OR ALTER PROCEDURE has been executed by
session 1.
So, anything wrong with snapshot isolation in Firebird 2.5? Is this
reproducable?
Thanks!
--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com
My blog:
http://blog.upscene.com/thomas/
an interesting case with Firebird 2.5 here. Its the same across all
architectures (SS, CS, SC).
Two sessions via isql to the same database.
- Session 1 creates or alters a SP
set echo on;
SET TERM ^^ ;
CREATE OR ALTER PROCEDURE P_1 returns (
I Integer)
AS
begin
i = 9;
suspend;
end ^^
SET TERM ; ^^
commit;
- Session 2 executes
SQL> select * from p_1;
I
============
9
Which is correct. In the same session:
SQL> commit;
Starting a new transaction with snapshot isolation.
SQL> set transaction snapshot;
- Session 1 now alters the stored procedure to
set echo on;
SET TERM ^^ ;
CREATE OR ALTER PROCEDURE P_1 returns (
I Integer)
AS
begin
i = 10;
suspend;
end ^^
SET TERM ; ^^
commit;
- Transaction of session 2 is still running (in snapshot isolation). I
then execute another :
SQL> select * from p_1;
I
============
10
Which IMHO is wrong.
With Firebird 2.1, the last select * from p_1 gives me 9 as result,
which is IMHO correct, because I started a snapshot isolation
transaction *before* the CREATE OR ALTER PROCEDURE has been executed by
session 1.
So, anything wrong with snapshot isolation in Firebird 2.5? Is this
reproducable?
Thanks!
--
Best Regards,
Thomas Steinmaurer
LogManager Series - Logging/Auditing Suites supporting
InterBase, Firebird, Advantage Database, MS SQL Server and
NexusDB V2
Upscene Productions
http://www.upscene.com
My blog:
http://blog.upscene.com/thomas/