Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres dialect detection broken on Postgres > 9 #820

Open
brianbolt opened this issue Nov 4, 2021 · 1 comment
Open

Postgres dialect detection broken on Postgres > 9 #820

brianbolt opened this issue Nov 4, 2021 · 1 comment
Assignees

Comments

@brianbolt
Copy link
Contributor

brianbolt commented Nov 4, 2021

We check in various places in acas-roo-server for the database type by doing:

import org.hibernate.dialect.PostgreSQL9Dialect;
		if (dialect instanceof PostgreSQL9Dialect) {

This is broken if the postgres database is anything but postgres 9.

There is one place this is used:

Affects container inventory (get location tree):
https://github.com/mcneilco/acas-roo-server/blob/2f327299562a7de40d0e510d767a15c4d9887707/src/main/java/com/labsynch/labseer/service/ContainerServiceImpl.java#L3546

These 2 places have a fix already in place for this:

if (dialect instanceof PostgreSQLDialect || dialect instanceof PostgreSQL9Dialect) {

Label sequence decrement sequence:
https://github.com/mcneilco/acas-roo-server/blob/410fef9a8d7ae071e3db9a9efec5f5f9026b72b2/src/main/java/com/labsynch/labseer/domain/LabelSequence.java#L194

Label sequence fetchCurrentValue:
https://github.com/mcneilco/acas-roo-server/blob/410fef9a8d7ae071e3db9a9efec5f5f9026b72b2/src/main/java/com/labsynch/labseer/domain/LabelSequence.java#L229

@brianbolt brianbolt self-assigned this Nov 4, 2021
@brianbolt
Copy link
Contributor Author

From my reading of the code, it doesn't looks like this would just cause exceptions rather than giving bad data.

All 3 functions throw exceptions when the dialect is incorrect rather than defaulting to some bad behavior.

brianbolt added a commit to mcneilco/acas-roo-server that referenced this issue Nov 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant