does frappe.db.commit() not work in server script in Frappe Cloud?

HI I am writing a server script in Frappe Cloud where I am trying to update a particular doctype(which is NOT THE DOCTYPE I HAVE CHOSEN IN DOCTYPE EVENT) using frappe.db.set_value(), then in order to save it i use frappe.db.commit(). But when the script tries to run I get the following error

AttributeError: module has no attribute 'commit'

Any ideas to whats wrong

change in the saved document data

Upvotes: 0

Views: 558

Answers (1)

gavin
gavin

Reputation: 892

Use of frappe.db.commit mid transaction can lead to unintended side effects like partial updates.

You don't need to explicitly commit in your Server Script, Frappe handles those bits for you.

Upvotes: 1

Related Questions