How does thingworx manage the transaction of Database Things ?
Hi,
I thought thingworx manage the transaction automatically for Database things and for each service will start a new or existing transaction. However, it doesn't behavior as my assumption.
For example:
TestDbTransA and TestDbTransB are Database things and the service AddOne & AddThree are SQL command services. I expect the service AddOne doesn't take effect as the exception occurs and the transaction should get rollback, however , AddOne service still insert record into the database.
So how does thingworx manager the transaction of database things ?
(function(){
var result = Things["TestDbTransA"].AddOne({
field: "1111" /* STRING */,
name: "1111" /* STRING */,
id: "1111" /* STRING */
});
if(true){
throw new Error("Error occurs, AddOne is supposed to be rollback");
}
var result2 = Things["TestDbTransB"].AddThree({
field: "3333" /* STRING */,
name: "3333" /* STRING */,
id: "3333" /* STRING */
});
})();
Regards,
Sean

