OpenSAP Course: SAP HANA Cloud Platform: Week3 Unit 1: Local Deployement Scenario
After executing all the steps shown in the video for unit 1 of week 3 (opening tunnel and configuring connection.properties) and requesting the application currently you see a response with an empty table for database entries.
But the video material on 20:01min shows a list of all the names added from the ejb and jdbc applications deployed in the cloud.
After recent changes in the Persistence Service introducing a development user concept it became no longer possible a locally deployed application to use the same schema as the application deployed in SAP HANA Cloud Platform.
When a database tunnel connects to a schema in the cloud a new development user (DEV_<GUID>) is created while the application in the cloud is using another user (NEO_GUID). Every user in the database has also default schema corresponding to the user name.
The application is by default using the default schema of the user with which the connection to the database is made. When the application is deployed to the cloud this is the NEO_GUID schema. In the local development scenario this is the DEV_GUID schema. This is the reason to see empty table in case of a locally deployed application.
Since the DEV_GUID user has the permissions to access the NEO_GUID schema the solution is to change the default schema used by the locally deployed application with NEO_GUID schema.
The solution is provided together with the SAP HANA Cloud Platform SDK version 188.8.131.52 which you can get at the SAP Development Tools For Eclipse webpage.
Steps to apply the solution: The same steps as shown in the video should be executed but with the use of the newest version of the HANA Cloud Platform SDK (min version: 184.108.40.206).
1. Download the latest SAP HANA Cloud Platform SDK (min version: 220.127.116.11).
2. In Eclipse create a new Runtime Environment or change the current one to use the newly downloaded and unzipped SDK.
3. Open the db-tunnel from the “tools” folder of the new SDK and connect to your schema in the cloud. The result should be like:
The difference with the previous version of the db tunnel is that the JDBC url has an additional parameter: currentschema=NEO_E7PL7GIVVQJZWQZ6L6NMPK239 which specifies the default schema which will be used in the database connection.
4. Run the application on a new Server created using the new Runtime (SDK: 18.104.22.168). Set up the connection properties using the new JDBC Url. You should get something like:
5. Restart the server and request the application. The result should be the same as shown in the video – the table should contain the database entries added from the jdbc application deployed in the cloud.