From b6d91d7042ae4d552c957c51720769a2817b60d6 Mon Sep 17 00:00:00 2001 From: sjvans <30337871+sjvans@users.noreply.github.com> Date: Thu, 30 Nov 2023 13:59:49 +0100 Subject: [PATCH 1/2] Update events.md --- node.js/events.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/node.js/events.md b/node.js/events.md index ed0c3d13a..946359d16 100644 --- a/node.js/events.md +++ b/node.js/events.md @@ -210,8 +210,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}` }) }) From bc85dde80ec3e6f1a9224c47b76f0f77543b4538 Mon Sep 17 00:00:00 2001 From: sjvans <30337871+sjvans@users.noreply.github.com> Date: Thu, 30 Nov 2023 14:12:26 +0100 Subject: [PATCH 2/2] Update cds-tx.md --- node.js/cds-tx.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/node.js/cds-tx.md b/node.js/cds-tx.md index 6d4bca217..9ded82a96 100644 --- a/node.js/cds-tx.md +++ b/node.js/cds-tx.md @@ -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.