Need help me how solve this problem I Get error concurent update?

Discussion of open issues, suggestions and bugs regarding IBDAC (InterBase Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mrUlugbek
Posts: 9
Joined: Fri 18 Nov 2011 04:21

Need help me how solve this problem I Get error concurent update?

Post by mrUlugbek » Thu 04 Feb 2016 05:11

Need help me how solve this problem I Get error concurent update?
I have
1)MainConnection
2)ReadTransaction isolation :ReadCommited
3)WriteTransaction isolation :Snapshot

Code: Select all

masterqry ='select * from master' ,  detailqry ='select * from detail'
  autocommit:=false
  chachedupdate:=true 
  localmasterdetail:=true  
  Transaction := ReadTransaction
  UpdateTransaction:=WriteTransaction

Code: Select all

and storedProcedure 
  autocommit:=false
  chachedupdate:=false
  Transaction := ReadTransaction
  UpdateTransaction:=WriteTransaction

on click button save

Code: Select all

do like this
masterqry.post;
detailqry.post;

try
  UpdateTransaction.start
  masterqry.commitupdates;
  detailqry.commitupdates;  
  storedProcedure.parambyname('P_ID').value:=masterqryID.value
  storedProcedure.execsql
  storedProcedure.close;
  UpdateTransaction.commit;
except
  UpdateTransaction.rollback;
  masterqry.cancelUpdates;
  detailqry.cancelUpdates;
  storedProcedure.close;
end

Code: Select all

stored procedure like this
ProcMasterTableUpdateBalance(ID)
begin
  update master
     set summa= (select sum(summ) from detail where masterid=:id)
  where  masterid=:id;
  
  
  update detail a
     set addamount = (select sum(summ)/0.1 from detail b where b.detailid=a.detailid and  b.masterid=:id)
  where  a.masterid=:id;
  
  delete from archivedetail where  masterid=:id;
  insert into archivedetail
  select * from detail where  masterid=:id;
  
end

ViktorV
Devart Team
Posts: 3168
Joined: Wed 30 Jul 2014 07:16

Re: Need help me how solve this problem I Get error concurent update?

Post by ViktorV » Fri 12 Feb 2016 15:41

Unfortunately, we couldn't reproduce the issue. In order to investigate the issue, please compose and send to viktorv*devart*com a full sample demonstrating the issue, including scripts for creating database objects.
Also note, that upon execution of the TIBCStoredProc.ExecSQL method, a transaction defined in the TIBCStoredProc.Transaction property, and not in the TIBCStoredProc.UpdateTransaction property, is used.

Post Reply