RTC Forums
November 24, 2024, 11:51:22 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   Home   Help Login Register  
Pages: [1]
  Print  
Author Topic: Transaction for many functions  (Read 4158 times)
ISIGest
RTC Expired
*
Posts: 121


« 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.
Logged
D.Tkalcec (RTC)
Administrator
*****
Posts: 1881


« Reply #1 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
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!
Page created in 0.022 seconds with 16 queries.