Transactional saving


Author
Message
Andria Jensen
Andria Jensen
StrataFrame User (444 reputation)StrataFrame User (444 reputation)StrataFrame User (444 reputation)StrataFrame User (444 reputation)StrataFrame User (444 reputation)StrataFrame User (444 reputation)StrataFrame User (444 reputation)StrataFrame User (444 reputation)StrataFrame User (444 reputation)
Group: Forum Members
Posts: 336, Visits: 497
I have 3 business objects which I want to create records for and then save on a transaction.  So, I know how the documentation says to do this and I have the following code in place:

TransactionBegin("", IsolationLevel.ReadCommitted)
AblStmtHdr.Save(True)
AblStmtDays.Save(True)
AblStmtRate.Save(True)
TransactionCommit("")

The issue here is that it is not saving out to the database correctly.  I have the following values before the transaction is commited:

AblStmtHdr.Count=1
AblStmtDays.Count=29
AblStmtRate.Count=3

However, when I check the database after the commit on the transaction I have 3 records for AblStmtHdr, 6 records for AblStmtRate, and 29 for AblStmtDays.  It has tripled the entry for AblStmtHdr, doubled it for AblStmtRate, and done a single entry for AblStmtDays (correctly).  These entries are created in a nested loop which is the only thing I can think of that could be affected anything here.  But, when I save them outside of a transaction they save correctly.  Is there anything I could be doing in code that is causing this behavior??  This code works correctly:

AblStmtHdr.Save()
AblStmtDays.Save()
AblStmtRate.Save()


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