geonetwork / geonetwork/core-geonetwork
Upgrading GN on Oracle database produces lots of errors
- Dominant language
- Java
- Stars
- 521
- Forks
- 515
- Avg merge
- 6d 13h
- Merged PRs (30d)
- 19
Description
**Describe the bug**
When using Oracle DB, there are a number of SQL statements in GN upgrade scripts that won't run against the database.
**To Reproduce**
Steps to reproduce the behavior:
1. Have an existing older GN instance running on Oracle DB.
2. Start a newer version of GN, which will trigger an upgrade process.
3. See errors in log.
**Expected behavior**
Upgrade DB objects without errors.
**Additional context**
Trying to upgrade GN on Oracle DB from version 3.8.2 to 4.4.3, had to fix a lot of minor issues related to Oracle DB.
One of the first errors when upgrading (or installing, for that matter) GN on Oracle is `ORA-01000: maximum open cursors exceeded`. This is caused by an unreasonly high (for me at least) setting `jdbc.basic.maxOpenPreparedStatements=1200` in file `web/src/main/webResources/WEB-INF/config-db/jdbc.properties`. On a default installation of Oracle DB, each session is limited to 300 open cursors.
Another small issue is Oracle JDBC connection string. In GN, this connection string still uses database `SID`. Nowadays most connections to the database are made with `service name`. Connection string differs slightly:
- SID: `jdbc:oracle:thin:@${host}:${port}:${sid}`
- Service name: `jdbc:oracle:thin:@${host}:${port}/${service_name}`
I will make a pull request with all changes that I had to make in order to upgrade the database.
Contributor guide
Research direction
Start with web/src/main/webResources/WEB-INF/config-db/jdbc.properties and reproduce the upgrade from GeoNetwork 3.8.2 to 4.4.3 against Oracle. Review the upgrade SQL statements and the JDBC settings mentioned in the issue. Done means the upgrade completes without Oracle errors, including the open-cursor and connection-string problems.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- backend, databases
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100