Hi everyone, please be informed that the course "Introduction to SAP HANA Cloud Platform" was updated with new functionalities of the platform. Some of the units from the first course in 2013 no longer work seamlessly. To avoid issues on your side, please look into the repetition of the course "Introduction to SAP HANA Cloud Platform". There is also a course guide available with the links to all blog posts I wrote for the updated course.
Hi everyone,
in the second week of the course Introduction to SAP HANA Cloud Platform we will provide you with some basics around the usage of the Persistence Service of our platform.
Find below additional information that can be useful to you during this course week. While monitoring the forums I'll also add some sections around common mistakes and how to fix them into the corresponding units.
When inserting a value in the ejb sample’s UI he following exception is displayed:
Persistence operation failed with reason: The bean encountered a non-application exception; nested exception is: javax.persistence.PersistenceException: Exception [EclipseLink-4002] (Eclipse Persistence Services - 2.4.1.v20121003-ad44345): org.eclipse.persistence.exceptions.DatabaseException Internal Exception: com.sap.db.jdbc.exceptions.JDBCDriverException: SAP DBTech JDBC: [274]: inserted value too large for column: 49620af6-80cd-454b-a95b-258eab7e287c Error Code: 274 Call: INSERT INTO T_PERSONS (ID, FIRSTNAME, LASTNAME) VALUES (?, ?, ?) bind => [3 parameters bound] Query: InsertObjectQuery(com.sap.cloud.sample.persistence.Person@8de9f444)
Solution: You’re using HANA schema without setting the additional property: <property name="eclipselink.target-database" value="com.sap.persistence.platform.database.HDBPlatform"/> in the persistence.xml.
1. go the cockpit -> Your application -> Database Schemas and delete the schema of the application.
2. set the property in persistence.xml
3. deploy/run the application again
Some participants realized that after deployment of their application they ended up with a schema on a MaxDB rather than a HANA database. You can check this in the Cloud Cockpit. Just click on Database Schemas and check the database type of your schema.
In the course you learned how to set the target database to com.sap.persistence.platform.database.HDBPlatform. (in the video this step has been shown at around 10:20). It is necessary to instruct EclipseLink to use HANA specific commands, types, etc. to access (an already existing) HANA database. However, it does not create a schema on a HANA database.
Actually a schema is created when an application is deployed in the cloud for the first time. The DB type that is used depends on the default settings that you can control in the Cloud Cockpit. So what you have to do in addition is to change the default settings in the Cloud Cockpit to HANA as described in Changing the Default Database and deploy your application with a new name (that forces the creation of a new schema).
The JPA Content should appear now.
Solution: use the newest version of the Java EE 6 sdk from https://tools.hana.ondemand.com/sdk/ this command is pretty new and can be missing in some older sdk versions
If you call "neo -help" it will list all the commands supported in this SDK. The open-db-tunnel command if is listed in the "persistence" group.
Solution:
1. Check the spelling of the host you provide in the command it should be hanatrial.ondemand.com.
2. Set up a proxy: Check the section below: “Should I use a proxy?”
Solution: Your proxy settings are either not correct or you don’t need to use a proxy at all. Check the section below: “Should I use proxy?”
Solution: You are calling ./neo.sh on windows. Windows users should use: neo.bat to execute the open-db-tunnel command.
Solution: Your schema is MaxDB so you don’t need the instance number to connect to it. However you cannot connect to a MaxDB schema using HANA Studio. You have two options:
Solution: When you add a new System in the HANA Studio there is an “Auto-reconnect” checkbox which is by default checked. So once a system is added in the HANA Studio it will try regularly to refresh the system and collect some meta-information. When the tunnel is closed the attempts to reconnect fail but when you open a new tunnel a new password will be created. The Studio however will try to reconnect with the old password which will result in authentication exceptions and that’s why you see the warning message in the console. If you don’t change the password in your system properties (in HANA Studio) fast enough the user will be locked after some time. The user will be unlocked next time you open the tunnel.
So you either have to immediately edit the password in HANA Studio every time you reconnect the tunnel or just un-select the “Auto-reconnect” checkbox when adding a new System (in this case you should refresh the system manually from the context menu).
Solution: Open the <HANA_studio_installation_folder>\hdbstudio.ini there should be a -vm parameter with value stating where the java.exe is located. (For example: C:\jdk1.7\bin\javaw.exe, usually in a new line just after the -vm parameter). Make sure that the VM used is Java 6 or Java 7. Sometimes when you have a previously installed old jdk the Hana Studio installer choose to use it.
To be able to establish a database tunnel through the console client you need to have your proxy settings setup correctly. Just follow this instruction: https://help.hana.ondemand.com/help/frameset.htm?7613dee4711e1014839a8273b0e91070.html
Check in the Firefox (Chrom) what kind of settings do you have for the proxy. Open "Tools"->"Options"->"Network"-> "Settings" There should be one of the following options selected:
User | Count |
---|---|
23 | |
11 | |
10 | |
9 | |
8 | |
6 | |
6 | |
5 | |
5 | |
5 |