Skip to content

Commit a447764

Browse files
Patch Release (#1819)
2 parents 985b6e7 + f5ea9e9 commit a447764

7 files changed

Lines changed: 33 additions & 18 deletions

File tree

about/best-practices.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ The *[Hexagonal Architecture](https://alistair.cockburn.us/hexagonal-architectur
597597

598598
... and he illustrated that like this:
599599

600-
![Hexagonal architecture basic.gif](https://alistair.cockburn.us/wp-content/uploads/2018/02/Hexagonal-architecture-basic-1.gif)
600+
![Hexagonal architecture basic.gif](https://alistair.cockburn.us/hexFig1.png)
601601

602602
In a nutshell, this introduction to the objectives of hexagonal architecture translates to that in our world of cloud-based business applications:
603603

get-started/troubleshooting.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -397,11 +397,24 @@ On trial, your SAP HANA Cloud instance will be automatically stopped overnight,
397397
| _Root Cause_ | SAP HANA still claims exclusive ownership of the data that was once deployed through `hdbtabledata` artifacts, even though the CSV files are now deleted in your project.
398398
| _Solution_ | Add an _undeploy.json_ file to the root of your database module (the _db_ folder by default). This file defines the files **and data** to be deleted. See section [HDI Delta Deployment and Undeploy Allow List](https://help.sap.com/docs/HANA_CLOUD_DATABASE/c2b99f19e9264c4d9ae9221b22f6f589/ebb0a1d1d41e4ab0a06ea951717e7d3d.html) for more details.
399399

400-
::: tip
401-
If you want to keep the data from _.csv_ files and data you've already added, see [SAP Note 2922271](https://me.sap.com/notes/2922271) for more details.
400+
401+
#### How do I keep existing data?
402+
If you want to keep the data from _.csv_ files and data you've already added, apply [SAP Note 2922271](https://me.sap.com/notes/2922271).
403+
Depending on whether you have a single-tenant or multi-tenant application, see the following details for how to set the `path_parameter` and `undeploy` parameters:
404+
405+
:::details Single-tenant applications {open}
406+
407+
Use the _db/undeploy.json_ file as given in the SAP note.
408+
The _package.json_ file that is mentioned in the SAP note is located in the _db/_ folder.
409+
- If you don't find a _db/package.json_ file, use _gen/db/package.json_ (created by `cds build`) as a template and copy it to _db/package.json_.
410+
- After the modification, run `cds build --production` and verify your changes have been copied to _gen/db/package.json_.
411+
- Don't modify _gen/db/package.json_ as it is overwritten on every build.
412+
402413
:::
403414

404-
You can apply this solution also when using the `cds-mtxs` library. You can either set the options via the environment variable [`HDI_DEPLOY_OPTIONS`](https://help.sap.com/docs/SAP_HANA_PLATFORM/4505d0bdaf4948449b7f7379d24d0f0d/a4bbc2dd8a20442387dc7b706e8d3070.html), the CDS configuration or you can add them to the model update request as `hdi` parameter:
415+
:::details Multi-tenant applications
416+
417+
Instead of configuring the static deployer application in _db/package.json_, use environment variable [`HDI_DEPLOY_OPTIONS`](https://help.sap.com/docs/SAP_HANA_PLATFORM/4505d0bdaf4948449b7f7379d24d0f0d/a4bbc2dd8a20442387dc7b706e8d3070.html), the `cds` configuration in _package.json_, or add the options to the model update request as `hdi` parameter:
405418

406419
CDS configuration for [Deployment Service](../guides/multitenancy/mtxs#deployment-config)
407420
```json
@@ -439,6 +452,11 @@ Options in [Saas Provisioning Service upgrade API](../guides/multitenancy/mtxs#e
439452
}
440453
```
441454

455+
:::
456+
457+
After you have successfully deployed these changes to all affected HDI (tenant) containers (in all spaces, accounts etc.), you can remove the configuration again.
458+
459+
442460
### How Do I Resolve Deployment Errors?
443461

444462
#### Deployment fails — _Cyclic dependencies found_ or _Cycle between files_

guides/providing-services.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ The same applies for fields with the [OData Annotations](../advanced/odata#annot
771771
Do not use the `@readonly` annotation on keys in all variants.
772772
:::
773773

774+
<div id="readonlywithexpressions"/>
775+
774776
### `@mandatory`
775777

776778
Elements marked with `@mandatory` are checked for nonempty input: `null` and (trimmed) empty strings are rejected.
@@ -792,7 +794,7 @@ In addition to server-side input validation as introduced above, this adds a cor
792794
</Annotations>
793795
```
794796

795-
797+
<div id="mandatorywithexpressions"/>
796798

797799
### `@Common.FieldControl`
798800
{#common-fieldcontrol}
@@ -962,7 +964,7 @@ entity Foo {
962964
}
963965
```
964966

965-
967+
<div id="assertconstraints" />
966968

967969
## Custom Logic
968970

java/_menu.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
# [Messaging](messaging)
2121
# [Audit Logging](auditlog)
2222
# [Change Tracking](../../java/change-tracking)
23+
# [State Transitions](../../java/flows)
2324
# [Transactional Outbox](outbox)
2425
# [Multitenancy](../../java/multitenancy)
2526
## [Multitenancy (Classic)](../../java/multitenancy-classic)

java/developing-applications/testing.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ As described in [Modular Architecture](building#starter-bundles#modular_architec
2121
Typical areas that require testing are the [services](../cqn-services/#cdsservices) that dispatch events to [event handlers](../event-handlers/), the event handlers themselves that implement the behaviour of the services, and finally the APIs that the application services define and that are exposed to clients through [OData](../cqn-services/application-services#odata-requests).
2222

2323
::: tip
24-
Aside from [JUnit](https://junit.org/junit5/), the [Spring framework](https://docs.spring.io/spring-framework/docs/current/reference/html/index.html) provides much convenience for both unit and integration testing, like dependency injection via [*autowiring*](https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans-factory-autowire) or the usage of [MockMvc](https://docs.spring.io/spring-framework/docs/current/reference/html/testing.html#spring-mvc-test-framework) and [*mocked users*]( https://docs.spring.io/spring-security/reference/servlet/test/method.html#test-method-withmockuser). So whenever possible, it's recommended to use it for writing tests.
24+
Aside from [JUnit](https://junit.org/junit5/), the [Spring framework](https://docs.spring.io/spring-framework/docs/current/reference/html/index.html) provides much convenience for both unit and integration testing, like dependency injection via [*autowiring*](https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans-factory-autowire) or the usage of [MockMvc](https://docs.spring.io/spring-framework/reference/testing/mockmvc.html) and [*mocked users*](https://docs.spring.io/spring-security/reference/servlet/test/method.html#test-method-withmockuser). So whenever possible, it's recommended to use it for writing tests.
2525
:::
2626

2727
## Sample Tests
@@ -222,7 +222,7 @@ For a more extensive version of the previous `CatalogServiceTest` snippets, have
222222

223223
Integration tests enable us to verify the behavior of a custom event handler execution doing a roundtrip starting at the protocol adapter layer and going through the whole CAP architecture until it reaches the service and event handler layer and then back again through the protocol adapter.
224224

225-
As the services defined in our `CDS model` are exposed as `OData` endpoints, by using [MockMvc](https://docs.spring.io/spring-framework/docs/current/reference/html/testing.html#spring-mvc-test-framework) we can simply invoke a specific `OData` request and assert the response from the addressed service.
225+
As the services defined in our `CDS model` are exposed as `OData` endpoints, by using [MockMvc](https://docs.spring.io/spring-framework/reference/testing/mockmvc.html) we can simply invoke a specific `OData` request and assert the response from the addressed service.
226226

227227
The following demonstrates this by invoking a `GET` request to the `OData` endpoint of our `Books` entity, which triggers the execution of the `discountBooks` method of the `CatalogServiceHandler` in our example:
228228

@@ -254,4 +254,4 @@ public class CatalogServiceITest {
254254

255255
::: tip
256256
Check out the version in our [CAP Java bookshop sample project](https://github.com/SAP-samples/cloud-cap-samples-java/blob/main/srv/src/test/java/my/bookshop/CatalogServiceITest.java) for additional examples of integration testing.
257-
:::
257+
:::

java/operating-applications/optimizing.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/
1717

1818
To minimize overhead at runtime, [monitoring](observability#monitoring) information is gathered rather on a global application level and hence might not be sufficient to troubleshoot specific issues.
1919
In such a situation, the use of more focused profiling tools can be an option.
20-
Typically, such tools are capable of focusing on a specific aspect of an application (for instance CPU or Memory management), but they come with an additional overhead and should only be enabled when needed. Hence, they need to meet the following requirements:
20+
Typically, such tools can focus on a specific aspect of an application (for instance CPU or Memory management), but they come with an additional overhead and should only be enabled when needed. Hence, they need to meet the following requirements:
2121

2222
* Switchable at runtime
2323
* Use a communication channel not exposed to unauthorized users
@@ -28,20 +28,13 @@ How can dedicated Java tools access the running services in a secure manner? The
2828
![This screenshot is explained in the accompanying text.](./assets/remote-tracing.png){width="600px"}
2929

3030
As an authorized operator, you can access the container and start tools [locally](#profiling-local) in a CLI session running with the same user as the target process. Depending on the protocol, the JVM supports on-demand connections, for example, JVM diagnostic tools such as `jcmd`. Alternatively, additional JVM configuration is required as a prerequisite (JMX).
31-
A bunch of tools also support [remote](#profiling-remote) connections in a secure way. Instead of running the tool locally, a remote daemon is started as a proxy in the container, which connects the JVM with a remote profiling tool via an ssh tunnel.
3231

3332
### Local Tools { #profiling-local}
3433

3534
Various CLI-based tools for JVMs are delivered with the SDK. Popular examples are [diagnostic tools](https://docs.oracle.com/javase/8/docs/technotes/guides/troubleshoot/toc.html) such as `jcmd`, `jinfo`, `jstack`, and `jmap`, which help to fetch basic information about the JVM process regarding all relevant aspects. You can take stack traces, heap dumps, fetch garbage collection events and read Java properties and so on.
3635
The SAP JVM comes with additional handy profiling tools: `jvmmon` and `jvmprof`. The latter, for instance, provides a helpful set of traces that allow a deep insight into JVM resource consumption. The collected data is stored within a `prf`-file and can be analyzed offline in the [SAP JVM Profiler frontend](https://wiki.scn.sap.com/wiki/display/ASJAVA/Features+and+Benefits).
3736

38-
### Remote Tools { #profiling-remote}
39-
40-
It's even more convenient to interact with the JVM with a frontend client running on a local machine. As already mentioned, a remote daemon as the endpoint of an ssh tunnel is required. Some representative tools are:
41-
42-
- [SAP JVM Profiler](https://wiki.scn.sap.com/wiki/display/ASJAVA/Features+and+Benefits) for SAP JVM with [Memory Analyzer](https://www.eclipse.org/mat/) integration. Find a detailed documentation how to set up a secure remote connection on [Profiling an Application Running on SAP JVM](https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/e7097737709842b7bb1c3b9bf3d688b6.html).
43-
44-
- [JProfiler](https://www.ej-technologies.com/products/jprofiler/overview.html) is a popular Java profiler available for different platforms and IDEs.
37+
<span id="cfclijava" />
4538

4639
### Remote JMX-Based Tools { #profiling-jmx}
4740

project-words.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,4 @@ Undeploying
1717
undiscloses
1818
unlocalized
1919
Woltmann
20+
asprof

0 commit comments

Comments
 (0)