Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: TFDConnection.GetLastAutoGenValue in a multi-user setting ?


This question is answered.


Permlink Replies: 1 - Last Post: Jun 7, 2017 10:50 PM Last Post By: Dmitry Arefiev
Maxime Bonin

Posts: 61
Registered: 1/23/17
TFDConnection.GetLastAutoGenValue in a multi-user setting ?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 6, 2017 12:13 PM
I'm working with Delphi XE8 and Microsoft SQL Server 2014

I use TFDConnection.GetLastAutoGenValue in order to get the ID (autoInc field) of the newly created record before a POST to database is completed.

My question is : if many users create a new record on the same table at roughly the same time, will each client software receive the accurate ID value ?

Thanks !
Dmitry Arefiev

Posts: 1,406
Registered: 12/7/03
Re: TFDConnection.GetLastAutoGenValue in a multi-user setting ?
Correct
Click to report abuse...   Click to reply to this thread Reply
  Posted: Jun 7, 2017 10:50 PM   in response to: Maxime Bonin in response to: Maxime Bonin
TFDConnection.GetLastAutoGenValue always returns session last generated value.

--
With best regards,
Dmitry
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02