Modify/update same row more than two times from BO on transaction not update it from 2nd time...


Modify/update same row more than two times from BO on transaction not...
Author
Message
Fabian R Silva, -
Fabian R Silva, -
StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)StrataFrame User (267 reputation)
Group: StrataFrame Users
Posts: 153, Visits: 1.2K
Hello, 
problem is that when loop the 2nd time, Save(lOnTr, sTrKEy) not do nothing because isDirty() is false... (1st time work ok)

how I can update a 2nd time the same table "Counter" on a transaction?
I need this because this will lock the number on MyTabkecounter an allow to use it in AnotherTable on a transaction without fear of that this number can be repeated



MyTableCounter
------------------------------
Id   |   Number
-----------------------------
1      5
2      99
3      999

dsk = "myDB"
lOnTr = true
sTrKey = "aTrKey"

BusinessLayer.TransactionBegin(dsk, trKey, IsolationLevel.ReadCommitted);
MyTableCounter.FillByPrimaryKey(1);
for(lnk=0;lnk<=5;lnk++)
{
   MyTableCounter.Number += 1;
   MyTableCounter.Save(lOnTr, sTrKey); --> this doesn't execute from 2nd time

   AnotherTable.NewRow();
        AnotherTable.MyTableCounterId = MyTableCounterId.Id;
   AnotherTable.Number = MyTable.Number;
   AnotherTable.Date = DateTime.Now.Date;
   AnotherTable.Save(lOnTr, sTrKey);
}

MyTableCounter.FillByPrimaryKey(2);
for(lnk=0;lnk<=5;lnk++)
{
   MyTableCounter.Number += 1;
   MyTableCounter.Save(lOnTr, sTrKey); --> this doesn't execute

   AnotherTable.NewRow();
   AnotherTable.Number = MyTable.Number;
   AnotherTable.Date = DateTime.Now.Date;
   AnotherTable.Save(lOnTr, sTrKey);
}



BusinessLayer.TransactionCommit(dsk, sTrKey);
GO

Merge Selected

Merge into selected topic...



Merge into merge target...



Merge into a specific topic ID...





Similar Topics

Reading This Topic

Login

Explore
Messages
Mentions
Search