Skip to content

Commit

Permalink
changes re tx for [email protected] (#562)
Browse files Browse the repository at this point in the history
* Update events.md

* Update cds-tx.md
  • Loading branch information
sjvans authored Dec 14, 2023
1 parent ad50fb0 commit 15f6146
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion node.js/cds-tx.md
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ The implementation guarantees decoupled execution from request-handling threads/

Think of it as if each run happens in an own thread with own context, with automatic transaction management.

By default, the nested context inherits all values from `cds.context`, especially user and tenant. Use the argument `options` if you want to override values, for example to run the background thread with different user or tenant than the one you called `cds.spawn()` from.
By default, the nested context inherits all values except `timestamp` from `cds.context`, especially user and tenant. Use the argument `options` if you want to override values, for example to run the background thread with different user or tenant than the one you called `cds.spawn()` from.



Expand Down
4 changes: 2 additions & 2 deletions node.js/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -217,8 +217,8 @@ To do something which requires databases in `succeeded`/`failed` handlers, use `

Example:
```js
req.on('done', () => {
await cds.tx(() => {
req.on('done', async () => {
await cds.tx(async () => {
await UPDATE `Stats` .set `views = views + 1` .where `book_ID = ${book.ID}`
})
})
Expand Down

0 comments on commit 15f6146

Please sign in to comment.