RTC Forums

Subscription => Support => Topic started by: ISIGest on October 22, 2013, 10:33:48 AM



Title: Transaction for many functions
Post by: ISIGest on October 22, 2013, 10:33:48 AM
What is the best way to implement a "custom" transaction (no sql data transaction) that start with a function called by client and commit with other function, but rollback when client disconnected abnormal.


Title: Re: Transaction for many functions
Post by: D.Tkalcec (RTC) on October 22, 2013, 10:44:25 AM
Each function is an independent piece of code, which knows nothing about any other functions. Functions also do not know the status of a connection during their execution and function execution will NOT be interrupted even if a connection breaks in the middle of executing a function. The only thing that will happen in that case, is that the client won't get the result prepared by the function.

There is nothing similar to "transaction control" built into functions. If you want to "rollback" what you have done or prepared in a function, you need to write that "rolling back" code yourself. It is not something that can be done automatically for you.

Best Regards,
Danijel Tkalcec