-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Low
-
Affects Version/s: 6.2.2
-
Component/s: Database (Oracle)
-
Severity 3 - Minor
Summary
Bamboo runs ALTER statements on startup to drop and re-create indices, as if Hibernate believes the index/constraint is incorrect.
The root cause is that Hibernate doesn't name indexes that back up the constraint it creates but it expects the name of the index to match the name of constraint, which is not the case on Oracle (and hsqldb)
Steps to Reproduce
- Add the following row to <bamboo-install>/atlassian-bamboo/WEB-INF/classes/log4j.properties:
log4j.category.org.hibernate=TRACE
- Add a Notification to a Build Plan
- Restart Bamboo
Expected Results
Bamboo starts up without updating schema
Actual Results
The below lines are shown in the atlassian-bamboo.log file, with log level DEBUG or higher on org.hibernate:
2017-11-07 11:32:07,532 INFO [localhost-startStop-1] [UpgradeLauncher] Updating database schema... alter table NOTIFICATIONS drop constraint notifications_unique 2017-11-07 11:32:27,061 DEBUG [localhost-startStop-1] [SQL] alter table NOTIFICATIONS drop constraint notifications_unique alter table NOTIFICATIONS add constraint notifications_unique unique (RECIPIENT_TYPE, RECIPIENT, NOTIFICATION_SET, CONDITION_KEY, CONDITION_DATA) 2017-11-07 11:32:27,204 DEBUG [localhost-startStop-1] [SQL] alter table NOTIFICATIONS add constraint notifications_unique unique (RECIPIENT_TYPE, RECIPIENT, NOTIFICATION_SET, CONDITION_KEY, CONDITION_DATA)
Workaround
Manually rename the indices to match the respective constraints.