Methods and systems for bulk row save logic in an object relational mapping layer and application framework
First Claim
Patent Images
1. A method comprising:
- receiving, from an object relational mapping layer Application Programming Interface (API) of a database in a known start state, a set of rows to save together in the database, wherein the database comprises a multi-tenant database system having elements of hardware and software shared by multiple customers, and further wherein the set of rows to save together comprises requests for multiple of the customers to be simultaneously processed together in the database;
saving the set of rows together in the database until each row not associated with faulting in the set of rows has been saved in the database;
determining that one or more faults occurred in saving the set of rows;
rolling back the set of rows to the known start state;
rolling back any side effects that were permitted to execute;
rolling back any resource usage counted against governor limits by executing side effects;
forming a new set of rows not associated with the one or more faults to save together in the database from the set of rows by removing rows associated with the one or more faults during the saving of the set of rows in the database;
repeatedly saving in the database and forming using the new set of rows until a set of rows that can be saved in the database from the known start state without fault is determined; and
updating resources used and checking against governor limits.
1 Assignment
0 Petitions
Accused Products
Abstract
In accordance with embodiments, there are provided mechanisms and methods for saving multiple rows together through an object relational mapping layer to a database. These mechanisms and methods for saving multiple rows together can enable embodiments to detect faults in the save operation(s) and recover. The ability of embodiments to detect faults in the save operation(s) and recover can enable embodiments to provide a robust forgiving published API that saves a set of rows together whenever possible.
-
Citations
17 Claims
-
1. A method comprising:
-
receiving, from an object relational mapping layer Application Programming Interface (API) of a database in a known start state, a set of rows to save together in the database, wherein the database comprises a multi-tenant database system having elements of hardware and software shared by multiple customers, and further wherein the set of rows to save together comprises requests for multiple of the customers to be simultaneously processed together in the database; saving the set of rows together in the database until each row not associated with faulting in the set of rows has been saved in the database; determining that one or more faults occurred in saving the set of rows; rolling back the set of rows to the known start state; rolling back any side effects that were permitted to execute; rolling back any resource usage counted against governor limits by executing side effects; forming a new set of rows not associated with the one or more faults to save together in the database from the set of rows by removing rows associated with the one or more faults during the saving of the set of rows in the database; repeatedly saving in the database and forming using the new set of rows until a set of rows that can be saved in the database from the known start state without fault is determined; and updating resources used and checking against governor limits. - View Dependent Claims (2, 3, 4, 5, 6, 7, 8, 9)
-
-
10. A non-transitory machine-readable medium having instructions stored thereon that, when executed by one or more processors, the instructions cause the one or more processors to perform operations comprising:
-
receiving, from an object relational mapping layer Application Programming Interface (API) of a database in a known start state, a set of rows to save together in the database, wherein the database comprises a multi-tenant database system having elements of hardware and software shared by multiple customers, and further wherein the set of rows to save together comprises requests for multiple of the customers to be simultaneously processed together in the database; saving the set of rows together in the database until each row not associated with faulting in the set of rows has been saved in the database; determining that one or more faults occurred in saving the set of rows; rolling back the set of rows to the known start state; rolling back any side effects that were permitted to execute; rolling back any resource usage counted against governor limits by executing side effects; forming a new set of rows not associated with the one or more faults to save together in the database from the set of rows by removing rows associated with the one or more faults during the saving of the set of rows in the database; repeatedly saving in the database and forming using the new set of rows until a set of rows that can be saved in the database from the known start state without fault is determined; and updating resources used and checking against governor limits. - View Dependent Claims (11, 12, 13, 14, 15)
-
-
16. An apparatus comprising:
-
a processor; and one or more stored sequences of instructions which, when executed by the processor, cause the processor to perform operations comprising; receiving, from an object relational mapping layer Application Programming Interface (API) of a database in a known start state, a set of rows to save together in the database, wherein the database comprises a multi-tenant database system having elements of hardware and software shared by multiple customers, and further wherein the set of rows to save together comprises requests for multiple of the customers to be simultaneously processed together in the database; saving the set of rows together in the database until each row not associated with faulting in the set of rows has been saved in the database; determining that one or more faults occurred in saving the set of rows; rolling back the set of rows to the known start state; rolling back any side effects that were permitted to execute; rolling back any resource usage counted against governor limits by executing side effects; forming a new set of rows not associated with the one or more faults to save together in the database from the set of rows by removing rows associated with the one or more faults during the saving of the set of rows in the database; repeatedly saving in the database and forming using the new set of rows until a set of rows that can be saved in the database from the known start state without fault is determined; and updating resources used and checking against governor limits.
-
-
17. A method comprising:
-
(A) receiving, from an object relational mapping layer Application Programming Interface (API) a database at a rollback point, a set of rows to save together in the database, wherein the database comprises a multi-tenant database system having elements of hardware and software shared by multiple customers, and further wherein the set of rows to save together comprises requests for multiple of the customers to be simultaneously processed together in the database; (B) attempting to save the set of rows together in the database, while recording fault information for any save operation in the database that faults, until each row not associated with faulting in the set of rows has been attempted to be saved in the database at least once; (C) determining whether faults occurred in attempting to save the set of rows together in the database; (D) committing the save in the database of the entire set of rows when the faults are determined not to have occurred in attempting to save the set of rows together in the database; (i) rolling back the attempting to save the set of rows together in the database to the rollback point when the faults are determined to have occurred in attempting to save the set of rows together in the database; (ii) rolling back resource limits placed upon code executing due to the attempting to save the set of rows together in the database when the faults are determined to have occurred in attempting to save the set of rows together in the database; (iii) removing rows corresponding to faults from the set of rows to save together to form a subset of rows not corresponding to faults to save together in the database; (iv) repeating (B) thorough (D) using the subset of rows as a new set of rows to save together in the database until a subset of rows that can be saved and committed in the database without fault is found, determined; and updating resources used with respect to resource limits.
-
Specification