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

Java: Config for SAP HANA HEX Engine #526

Merged
merged 5 commits into from
Nov 14, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions java/persistence-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,27 @@ cds:

### SAP HANA

#### Service Bindings

SAP HANA can be configured when running locally as well as when running productively in the cloud. The datasource is auto-configured based on available service bindings in the `VCAP_SERVICES` environment variable or locally the _default-env.json_. This only works if an application profile is used, that doesn't explicitly configure a datasource using `spring.datasource.url`. Such an explicit configuration always takes precedence over service bindings from the environment.

Service bindings of type *service-manager* and, in a Spring-based application, *hana* are used to auto-configure datasources. If multiple datasources are used by the application, you can select one auto-configured datasource to be used by the default Persistence Service through the property `cds.dataSource.binding`.

#### SQL Optimization Mode

By default, CAP Java generates SQL in `legacy` _optimization mode_, which is compatible with SAP HANA Cloud Edition as well as with HANA 2.x (HANA as a Service). If your deployment target is SAP HANA Cloud Edition you can also specifiy the optimization mode `hex`. In `hex` mode, CAP generates SQL that will _only_ run on the [HEX engine](https://help.sap.com/docs/SAP_HANA_PLATFORM/9de0171a6027400bb3b9bee385222eff/3861d0908ef14e8bbec1d76ea871ac0f.html#sap-hana-execution-engine-(hex)) of SAP HANA Cloud Edition:
agoerler marked this conversation as resolved.
Show resolved Hide resolved

```yaml
cds:
sql:
hana:
optimizationMode: hex
agoerler marked this conversation as resolved.
Show resolved Hide resolved
```

:::tip
Use the [hints](.../java/query-execution#hana-hints) `hdb.USE_HEX_PLAN` and `hdb.NO_USE_HEX_PLAN` to overrule the configured optimization mode per statement.
renejeglinsky marked this conversation as resolved.
Show resolved Hide resolved
:::

### PostgreSQL { #postgresql-1 }

PostgreSQL can be configured when running locally as well as when running productively in the cloud. Similar to HANA, the datasource is auto-configured based on available service bindings, if the feature `cds-feature-postgresql` is added.
Expand Down