cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

The PTC Community email address has changed to community-mailer@ptc.com. Learn more.

Using transaction in a ThingWorx service

Using transaction in a ThingWorx service

Hello all,

 

It would be really nice if some transaction mechanism could be setup in ThingWorx services. This transaction can be commited or rollbacked if developper catch an exception and explicitly rollback the transation.

 

For instances, as a pseudo algo:

  • Open transaction
    • Insert line in datatable
    • Create Thing1
    • Insert Value Stream
  • Exception raised
    • Rollback called -> Every previous operation should be reversed.

 

Such mechanism may bring some more confidence about data integrity inside ThingWorx.

 

Thanks for reading.

Guillaume

5 Comments
olivierlp
Community Manager
Status changed to: Clarification Needed

Thank you for publishing your idea. We need more information as specified in the form you saw in the submission process. (Questions below).
Please let us know within the next two weeks.
1. What version of Thingworx are you currently running?

2. Describe the problem you are trying to solve. Please include detailed documentation such as screenshots, images or video.

3. What business value would your suggestion represent for your organization?

GuillaumeLaroch
11-Garnet
  1. ThingWorx 9.0
  2. In the application, user can create an object but behind the scene it creates several things, fill some streams and data table. If an issue appears during this process, we can handle the issue but to be able to go back to a stable state (undoing all previous actions) is a bit complex.
  3. Two words : "Data Consistency". To be sure that at any time all data is consistent in the application is something critical.
olivierlp
Community Manager
Status changed to: Acknowledged

Hello,
Thank you for your idea and the information provided.

cbaldwin
13-Aquamarine
Status changed to: No Plans to Implement

Hello,

 

There are no plans to implement transactions in the near or medium term roadmap for ThingWorx platform.  We can keep it under consideration for future roadmap.

 

Thank you for your idea.

Chris

TomV
7-Bedrock

@GuillaumeLaroch @cbaldwin @olivierlp 

 

This is implemented using the base building blocks where the databasething has an "executeservice" that executes the code inside a transaction.

 

The documentation on it is lacking but it does work

https://support.ptc.com/help/building_blocks/r1.0/en/index.html#page/bb%2Fbuilding_blocks%2Fdatabase_connection_bb%2Fdatabase_connection_bb.html%23wwconnect_header