Solved ODBC connect to DB2 - no Commit after select

General discussion forum about all databases other than SqlBase.
ploetner

ODBC connect to DB2 - no Commit after select

Post by ploetner » 14 Feb 2012, 10:17

Hello,

we need your help regarding the following problem.
We have converted a Teamdeveloper Application (TD 3.1) to connect to DB2 now via ODBC we and have found the following problem:

After doing a select statement and a commit, the commit will not free the locks in the db2 database.
That means if an other user try to update the row in the table, the user will get a deadlock / timeout.
A commit after a SQL update statement will work correct and free the locks.


Codepart of the select in Application is like:

Code: Select all

Set bPopulateOk = SalTblPopulate( tblDB2Lock1, hgSql, "select  USERID, DOKU_COD, DOKNR, SORT_KZ from T#BIEA.D1W210T where USERID = user and DOKNR = 121066", TBL_FillAll) 
Call SqlPrepareAndExecute( hgSql, 'COMMIT' ) 
Codepart of update is like (excuted in sqltalk):

Code: Select all

update T#BIEA.D1W210T set DOKU_COD = 'AUS'  where USERID = user and DOKNR = 121066; 

FRBhote
India
Posts: 2217
Joined: 09 Mar 2017, 05:32
Location: Hyderabad, India

Re: ODBC connect to DB2 - no Commit after select

Post by FRBhote » 14 Feb 2012, 12:12

Have you set the Isolation Level to RL?

ploetner

Re: ODBC connect to DB2 - no Commit after select

Post by ploetner » 20 Feb 2012, 09:24

The isolation level was related - but thank for this hint - we have used default autocommit setting and after explizit setting of this parameter the issue is gone

Return to “General Discussion”

Who is online

Users browsing this forum: [Ccbot] and 0 guests