Hi, Yes, I think that the update and delete methods in CompanyClient can be changed to restrict only one row getting affected at a time and this will fix the current issue.
I would also like to get a clear understanding of JIRA 866. Is it that the changes for making default DAS behaviour to use overqualified column is causing this issue (preventing simple batch update/delete)? Is there a way to make the behavior ON/OFF? If there is no way at present, will it be a useful change? Also, just want to make sure, before JIRA 866, was DAS allowing statement like update department set name='xx' where id=1 to update more than 1 row at a time , or at that time also (pre-866), there was some way to prevent such multiple row updates. Regards, Amita On 5/25/07, Adriano Crestani <[EMAIL PROTECTED]> wrote:
Hi Amita, We could fix the batch problem as you suggested on CompanyWeb sample and add the batch support on next release. What do you think? Adriano Crestani On 5/24/07, Amita Vadhavkar <[EMAIL PROTECTED]> wrote: > > Hello Luciano, > > In the companyweb integration with dbconfig - update and delete was > not working for > the below reason:- > The config for dbconfig util had > 1><Table name="DEPARTMENT" SQLCreate="CREATE TABLE DEPARTMENT (ID INT > PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY, NAME > VARCHAR(30),LOCATION VARCHAR(30), DEPNUMBER VARCHAR(10),COMPANYID > INT)"> > <row>'Advanced Technologies', 'NY', '123', 1</row> > <row>'Default Name 2', '', '', 1</row> > <row>'Default Name 3', '', '', 1</row> > <row>'Default Name 4', '', '', 1</row> > <row>'Default Name 5', '', '', 1</row> > <row>'Default Name 6', '', '', 1</row> > <row>'Default Name 7', '', '', 1</row> > <row>'Default Name 8', '', '', 1</row> > </Table> > > Changing it to below, made update and delete to succeed > 2><Table name="DEPARTMENT" SQLCreate="CREATE TABLE DEPARTMENT (ID INT > PRIMARY KEY NOT NULL GENERATED ALWAYS AS IDENTITY, NAME > VARCHAR(30),LOCATION VARCHAR(30), DEPNUMBER VARCHAR(10),COMPANYID > INT)"> > <row>'Advanced Technologies', 'NY', '123', 10</row> > <row>'Default Name', '', '', 1</row> > <row>'Default Name', '', '', 1</row> > <row>'Default Name', '', '', 1</row> > <row>'Default Name', '', '', 1</row> > <row>'Default Name', '', '', 1</row> > <row>'Default Name', '', '', 1</row> > <row>'Default Name', '', '', 1</row> > </Table> > > This is because, DAS at present does not support batch update. So, in > the original config,1> > when update department name for companyid 1 was fired, the statements > formed were > > update department set name='xyz' where id=1 and name='Advanced > Technologies' > update department set name='xyz' where id=2 and name='Advanced > Technologies' > update department set name='xyz' where id=3 and name='Advanced > Technologies' > ... > > Now as there is no matching row, for id=2 and name='Advanced > Technologies', > OptimisticWriteCommandImpl.basicExecute() was giving 0 rowsAffected and > thus > OCC Exception that update collision occured. > > With changed to 2>, the where clause works correct by luck as all old > values > are 'Default Name'. > > So, the proper solution will be restricting only one update statement > to be fired > instead of batch update/delete. This will need change in > CompanyClient.changeFirstCompanysDepartmentNames() > and CompanyClient.deleteDepartmentsFromFirstCompany(). > > DAS by design calls one updateGenerator.getUpdateCommand() for one > applyChanges() and sets the values of collision param in it. > So, if there is batch , it can not do batch updates with proper values > in where clauses. > > It looks like this can be covered under JIRAs created for Tuscany DAS > Features/Questions - > http://www.mail-archive.com/[email protected]/msg17813.html > > Regards, > Amita > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > >
