question

pixeljump avatar image
pixeljump asked

Wrapping cloud script in a transaction, EntityFramework style?

I have a function call which handles 3-4 writes at different parts, but it is vital they either all execute or none of them. Is there a way to declare intent and then execute them in a batch, with auto rollback if something were to happen?

I realise this is a pretty advanced feature, but I'm sure it would be used a lot if implemented.

CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
Sarah Zhang avatar image
Sarah Zhang answered

Yes, it’s a pretty advanced feature. Currently, it’s truly difficult to implement such “transaction” on CloudScript. CloudScript is not atomic, and can’t do some database operations directly. PlayFab stores data in an underlying database, but the raw database is hidden from the developer.

If you think it is necessary to implement transaction mechanism on CloudScript. You can try to add a feature request of it.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.