Re: [firebird-support] Deadlock exception occurs but it shouldn't?

2014-12-28 Thread 'Walter R. Ojeda Valiente' sistemas2000profesio...@gmail.com [firebird-support]
Vlad, your explanation is very good, but I still don't understand something: Why before step 1 the engine does not blocks the record avoiding such problem? Greetings. Walter. On Sat, Dec 27, 2014 at 5:19 AM, hv...@users.sourceforge.net [firebird-support] firebird-support@yahoogroups.com wrote:

Re: [firebird-support] Deadlock exception occurs but it shouldn't?

2014-12-27 Thread hv...@users.sourceforge.net [firebird-support]
Update, internally, consists of following steps (simplified) : 1. read record 2. evaluate new record 3. write new record into data page really, it is a more complex, but for now we interesting only in steps above. At step 1, read-committed (RC) transaction waits for commit or rollback of

Re: [firebird-support] Deadlock exception occurs but it shouldn't?

2014-12-27 Thread brucedickin...@wp.pl [firebird-support]
Vlad, that helped me a lot, thank you. It is good to know what is going under the hood of Firebird. Now everything is much clearer for me and I know how to proceed with my problem. Best regards.

Re: [firebird-support] Deadlock exception occurs but it shouldn't?

2014-12-26 Thread Ann Harrison aharri...@ibphoenix.com [firebird-support]
On Dec 24, 2014, at 3:22 AM, brucedickin...@wp.pl [firebird-support] firebird-support@yahoogroups.com wrote: I have two threads which constantly and at the same time are writing to this table: UPDATE OR INSERT INTO PARAMS (NAME) VALUES(:P_NAME) MATCHING (NAME) RETURNING ID;

Re: [firebird-support] Deadlock exception occurs but it shouldn't?

2014-12-26 Thread 'Walter R. Ojeda Valiente' sistemas2000profesio...@gmail.com [firebird-support]
Hello Ann Maybe I am not understanding correctly, but: *Case 1:* - Transaction T1 starts with settings: READ WRITE WAIT READ COMMITTED - Transaction T1 updates a record which ID is 23 - Transaction T2 starts with settings: READ WRITE WAIT READ COMMITTED - Transaction T2 updates the

[firebird-support] Deadlock exception occurs but it shouldn't?

2014-12-24 Thread brucedickin...@wp.pl [firebird-support]
Hi, I have a very simple table: CREATE TABLE PARAMS ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, CONSTRAINT PK_PARAMS PRIMARY KEY (ID), CONSTRAINT UNQ_PARAMS UNIQUE (NAME) ); I have two threads which constantly and at the same time are writing to this table: UPDATE OR INSERT

Re: [firebird-support] Deadlock exception occurs but it shouldn't?

2014-12-24 Thread Mark Rotteveel m...@lawinegevaar.nl [firebird-support]
On 24-12-2014 09:22, brucedickin...@wp.pl [firebird-support] wrote: I have a very simple table: CREATE TABLE PARAMS ( ID INTEGER NOT NULL, NAME VARCHAR(32) NOT NULL, CONSTRAINT PK_PARAMS PRIMARY KEY (ID), CONSTRAINT UNQ_PARAMS UNIQUE (NAME) ); I have two threads which

Re: [firebird-support] Deadlock exception occurs but it shouldn't?

2014-12-24 Thread Hugo Eyng hugoe...@msn.com [firebird-support]
Hi. You should 'lock' the record you are working with. Did you read about 'with lock'? I am not sure this will help you in this case, but Hugo On 24/12/2014 06:22, brucedickin...@wp.pl [firebird-support] wrote: Hi, I have a very simple table: CREATE TABLE PARAMS ( ID INTEGER NOT