web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Finance | Project Operations, Human Resources, ...
Suggested Answer

select for update x++

(0) ShareShare
ReportReport
Posted on by 554
Hi,

When we do

ttsbegin;
select for update table1 where table1.Id =='A';  //first DB hit
table1.Field1 = "X";
table1.update();  //second DB hit
ttscommit;  //third DB hit
 
 
is it really 3 database calls?
 
 
 
Categories:
I have the same question (0)
  • Suggested answer
    Deepak Agarwal Profile Picture
    9,101 on at
    I dont think there will be 3 DB calls, it must be 2 only.
    First when you do select for update,
    and secondly when you call table.update().
     
    while ttscommit isn't a query its just commits the transaction but it does interact with SQL but doesnt fetch or modify any data. 
  • Suggested answer
    Subra Profile Picture
    1,479 on at
    Hi 

    I hope only 2 calls for DB not 3 DB calls.

    Only for Select and Update.
     
    Thanks,
    Subra

    If this helped, please mark it as "Verified" for others facing the same issue
  • Suggested answer
    André Arnaud de Calavon Profile Picture
    305,938 Super User 2026 Season 1 on at
    Hi Deldyn,
     
    Actually, there are three database operations with your example. Two calls on the table, and one command for managing the consistency of the database. 
    There is a read, an update, and transaction commitment. 
     
    In case of multiple updates, the ttscommit will mark the database changes as complete. If you encounter an error, you can use ttsabort, which will remove all uncommitted changes. If you want to learn a bit more, you can read a blog post where I wrote about interacting with uncommitted changes: How to: Read uncommitted records using Dynamics 365 for Operations.
     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders

These are the community rock stars!

Leaderboard > Finance | Project Operations, Human Resources, AX, GP, SL

#1
Abhilash Warrier Profile Picture

Abhilash Warrier 461 Super User 2026 Season 1

#2
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 458 Super User 2026 Season 1

#3
Subra Profile Picture

Subra 450

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans