2

I've built a 2 end point flask backed using flask sqlalchemy, where one end-point is for getting the data another for updating the data. Now the question is, how do I ensure that the same row which is pulled for editing is not being served to another user. I tried using with_for_update() within my query with no luck, something like this for the "getData()" end point,

def getDatum():
   qu = Users.query.join(id=b.id).with_entities(Users.a, Users.b, 
   B.name).with_for_update().filter(Users.id!=id).first()

however, the row is not being locked or in a state where the other users are not served the same, I've researched a lot but couldn't find anything helpful.

Ven
  • 57
  • 5

0 Answers0