Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: Concurrency issue


This question is answered.


Permlink Replies: 1 - Last Post: Mar 1, 2016 8:59 PM Last Post By: Dmitry Arefiev
Paulo Mariano

Posts: 29
Registered: 11/25/12
Concurrency issue  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 1, 2016 3:00 PM
Hello.

In the Informix configuration file "onconfig", DEADLOCK_TIMEOUT has been set to 60 ([https://www-01.ibm.com/support/knowledgecenter/SSGU8G_11.70.0/com.ibm.adref.doc/ids_adr_0050.htm]).

Considering this setting, the following test was conducted:
1) In Server Studio, these statements were executed:
begin work;
lock table test in exclusive mode;


2) In another instance of Server Studio, the following statement was executed:
insert into test values (0.1, 0.2);


Since the table was locked by step #1, the insert statement was not executed immediately.

3) Back in the first instance of Server Studio, the following statement was executed:
commit;


4) With the release of the lock, the insert statement of the second instance of Server Studio was successfully executed.

A similar test was conducted in an application using Delphi XE6 and FireDAC:
5) In Server Studio, the following statements were executed:

begin work;
lock table test in exclusive mode;


6) In the Delphi application, the following statements were executed:
Query1.SQL.Text :=  'insert into test (col1, col2) values (0.1, 0.2)';
Query1.ExecSQL;

and the following error message was immediately displayed:
[FireDAC][Phys][ODBC][Informix][Informix ODBC Driver][Informix] Could not insert new row into the table. sqlerrm (test)

Despite the database configuration, it seems the FireDAC connection overrides or disregards setting DEADLOCK_TIMEOUT, since the error message is displayed right away.
Is there a way to configure the FireDAC connection so that the mentioned database setting is taken into account when a table is locked?

Thank you in advance.

Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: Concurrency issue
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 1, 2016 8:58 PM   in response to: Paulo Mariano in response to: Paulo Mariano
DEADLOCK_TIMEOUT is for distributed transactions.
To force a session to wait for a lock to be released,
execute SET LOCK MODE command in this session:
https://www-01.ibm.com/support/knowledgecenter/SSGU8G_12.1.0/com.ibm.sqls.doc/ids_sqs_1171.htm

--
With best regards,
Dmitry

Edited by: Dmitry Arefiev on Mar 2, 2016 8:58 AM
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02