Re: [Firebird-devel] ODP: ODP: ODP: Inserts and FKs

2019-09-07 Thread Carlos H. Cantu
Title: Re: [Firebird-devel] ODP: ODP: ODP: Inserts and FKs


If you had understood the case, you would have noticed that the transaction in isql-1 doesn't matter. Either readcommited or snapshot will show the same result. That's why I didn't mind about running set transaction in my step-by-step instructions.

isql-2 must be snapshot, and this is the default isolation for isql transactions (so, no need for set transaction).

Point is: there is an inconsistency in the currently Firebird behavior that can be easily reproduced.

I'll open a ticket in the tracker. Since I have zero knowledge about FB code, I cannot fix it by myself. IMHO, this ia a serious problem that deserves attention.

[]s
Carlos
http://www.firebirdnews.org
FireBase - http://www.FireBase.com.br






Why do you think that one isql have transaction read commited but second have snapshot?
I do not see your transaction command.
If you depend on automatic transactions started by isql, then both are the same, no randomness...

Regards,
Karol Bieniaszewski





Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] ODP: ODP: ODP: Inserts and FKs

2019-09-06 Thread liviuslivius
Why do you think that one isql have transaction read commited but second have 
snapshot? I do not see your transaction command. If you depend on automatic 
transactions started by isql, then both are the same, no 
randomness...Regards,Karol Bieniaszewski
nullFirebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] ODP: ODP: ODP: Inserts and FKs

2019-09-06 Thread Carlos H. Cantu
Let's go, based on Karol's previous example. 

Open two isql sessions (isql1 and isql2) connected to the same database, and 
follow the sequence of commands in this order:

isql1:
CREATE TABLE A
(
ID BIGINT NOT null PRIMARY KEY);

CREATE TABLE B
(
ID BIGINT NOT null PRIMARY KEY,
ID_A BIGINT NOT NULL
);

ALTER TABLE B ADD constraint FK_B__A FOREIGN KEY(ID_A) REFERENCES A(ID) ON 
UPDATE CASCADE ON DELETE CASCADE;

commit;
INSERT INTO A (ID) VALUES (1);

isql2:
commit; -- to be sure that if there is active transaction, it will be ended now
select * from a; -- just to be sure that snapshot transaction is started now

isql1:
commit;

isql2:
INSERT INTO B (ID, ID_A) VALUES (1, 1); -- This should break, since master 
should not be visible for this transaction, but FB will accept it
commit;

No errors at all! 

[]s
Carlos
http://www.firebirdnews.org
FireBase - http://www.FireBase.com.br

DS> 06.09.2019 23:00, Carlos H. Cantu wrote:
>> Sending screenshots of the isql sessions will not help, since what really 
>> matters is the 
>> time of starting/commit the transactions.

DS>You don't need to send screenshots. Send script. Second instance of isql 
can be run in
DS> the right moment using command "shell".Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] ODP: ODP: ODP: Inserts and FKs

2019-09-06 Thread Dimitry Sibiryakov

06.09.2019 23:00, Carlos H. Cantu wrote:
Sending screenshots of the isql sessions will not help, since what really matters is the 
time of starting/commit the transactions.


  You don't need to send screenshots. Send script. Second instance of isql can be run in 
the right moment using command "shell".



--
  WBR, SD.


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


Re: [Firebird-devel] ODP: ODP: ODP: Inserts and FKs

2019-09-06 Thread Carlos H. Cantu
Title: Re: ODP: [Firebird-devel] ODP:  ODP:  Inserts and FKs


You can use your own example (that you sent before), just follow the comments that I marked in red, and you will reproduce the problem.

Sending screenshots of the isql sessions will not help, since what really matters is the time of starting/commit the transactions.

[]s
Carlos
http://www.firebirdnews.org
FireBase - http://www.FireBase.com.br





Better show your commands in isql then we can reproduce problem.
 
Regards,
Karol Bieniaszewski





Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel


[Firebird-devel] ODP: ODP: ODP: Inserts and FKs

2019-09-06 Thread Karol Bieniaszewski
Better show your commands in isql then we can reproduce problem.

Regards,
Karol Bieniaszewski
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel