Skip to content

Commit

Permalink
Java: Config for SAP HANA HEX Engine (#526)
Browse files Browse the repository at this point in the history
* Update persistence-services.md

Document config for SAP HANA HEX Engine

* Update java/persistence-services.md

* Apply suggestions from code review

Co-authored-by: Matthias Schur <[email protected]>

* Update java/persistence-services.md

---------

Co-authored-by: René Jeglinsky <[email protected]>
Co-authored-by: Matthias Schur <[email protected]>
  • Loading branch information
3 people authored Nov 14, 2023
1 parent 2b6f89a commit acef96a
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions java/persistence-services.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,25 @@ 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, the SAP HANA adapter in CAP Java generates SQL that is compatible with SAP HANA 2.x ([HANA Service](https://help.sap.com/docs/HANA_SERVICE_CF/6a504812672d48ba865f4f4b268a881e/08c6e596b53843ad97ae68c2d2c237bc.html)) and [SAP HANA Cloud](https://www.sap.com/products/technology-platform/hana.html).
To generate SQL that is optimized for the new [HEX engine](https://help.sap.com/docs/SAP_HANA_PLATFORM/9de0171a6027400bb3b9bee385222eff/3861d0908ef14e8bbec1d76ea871ac0f.html#sap-hana-execution-engine-(hex)) in SAP HANA Cloud, set the [CDS property](development/properties#cds-properties):

```yaml
cds.sql.hana.optimizationMode: hex
```

:::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.
:::

### 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

0 comments on commit acef96a

Please sign in to comment.