Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add SAVEPOINTs for internal APIs - enable data modifications in Observable streams #41

Open
artem-v-shamsutdinov opened this issue Mar 18, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@artem-v-shamsutdinov
Copy link
Member

Right now the only way to make data modifications from within an observable stream handler is to setup a second application and make a call to it (this forcing a transaction creation). This is inconvenient and should be improved:

API calls made within an Application should also have SAVEPOINTs associated with them. This allows for better error handling. More importantly it this allows for transactions to be kicked off outside of an external API call context. A perfect example of this is performing a modification within an Observable stream handler.

To accomplish this every @Api() call should be instrumented with a transactional wrapper. This means that there should be code generated specifically for the @Api() decorators (and an exception needs to be added to @airport/taxiway not to strip that code). The instrumented code will:

  1. reach out to AIRport server and forward the request to the AIRport server - which will start a nested transaction
  2. wait for a response from the AIRport server and return the results

The instrumented code should only be invoked if the call wasn't made externally (there should be a flag in the @airport/tower harness to disable the instrumented code for external calls).

Only the @Api() calls that return Promises will be instrumented (can't do transactions from within calls that return Observables).

NOTE: An alternative implementation would start and stop transactions but that would double the amount of messaging required between the App Frames and the parent window (in Web Mode).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

1 participant