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

[Bug] PostgreSQL support #48

Closed
bivashy opened this issue Jul 11, 2023 · 1 comment
Closed

[Bug] PostgreSQL support #48

bivashy opened this issue Jul 11, 2023 · 1 comment
Labels
priority: medium Issue or PR review is priority if no higher tasks exists type: bug Something isn't working

Comments

@bivashy
Copy link
Owner

bivashy commented Jul 11, 2023

When plugin enables with existing auth table, it will throw this exception:

02:04:34 [SEVERE] java.sql.SQLException: SQL statement failed: CREATE SEQUENCE "auth_links_id_seq"
02:04:34 [SEVERE]     at com.bivashy.auth.lib.com.j256.ormlite.table.TableUtils.doStatements(TableUtils.java:395)
02:04:34 [SEVERE]     at com.bivashy.auth.lib.com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:371)
02:04:34 [SEVERE]     at com.bivashy.auth.lib.com.j256.ormlite.table.TableUtils.doCreateTable(TableUtils.java:356)
02:04:34 [SEVERE]     at com.bivashy.auth.lib.com.j256.ormlite.table.TableUtils.createTableIfNotExists(TableUtils.java:99)
02:04:34 [SEVERE]     at me.mastercapexd.auth.database.dao.AccountLinkDao.<init>(AccountLinkDao.java:36)
02:04:34 [SEVERE]     at me.mastercapexd.auth.database.DatabaseHelper.lambda$new$0(DatabaseHelper.java:59)
02:04:34 [SEVERE]     at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
02:04:34 [SEVERE]     at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
02:04:34 [SEVERE]     at java.base/java.lang.Thread.run(Thread.java:833)
02:04:34 [SEVERE] Caused by: org.postgresql.util.PSQLException: ERROR: relation "auth_links_id_seq" already exists
02:04:34 [SEVERE]     at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2676)
02:04:34 [SEVERE]     at org.postgresql.core.v3.QueryExecutorImpl.processResults(QueryExecutorImpl.java:2366)
02:04:34 [SEVERE]     at org.postgresql.core.v3.QueryExecutorImpl.execute(QueryExecutorImpl.java:356)
02:04:34 [SEVERE]     at org.postgresql.jdbc.PgStatement.executeInternal(PgStatement.java:496)
02:04:34 [SEVERE]     at org.postgresql.jdbc.PgStatement.execute(PgStatement.java:413)
02:04:34 [SEVERE]     at org.postgresql.jdbc.PgPreparedStatement.executeWithFlags(PgPreparedStatement.java:190)
02:04:34 [SEVERE]     at org.postgresql.jdbc.PgPreparedStatement.execute(PgPreparedStatement.java:177)
02:04:34 [SEVERE]     at com.bivashy.auth.lib.com.j256.ormlite.jdbc.JdbcCompiledStatement.runExecute(JdbcCompiledStatement.java:73)
02:04:34 [SEVERE]     at com.bivashy.auth.lib.com.j256.ormlite.table.TableUtils.doStatements(TableUtils.java:389)
02:04:34 [SEVERE]     ... 8 more

As we can see in stack trace, this is occurred because of ORMLite issue (j256/ormlite-core#20)

@bivashy bivashy added type: bug Something isn't working priority: medium Issue or PR review is priority if no higher tasks exists labels Jul 11, 2023
@bivashy
Copy link
Owner Author

bivashy commented Jul 11, 2023

I think we can just use IdentityPostgresDatabaseType from j256/ormlite-core#20 (comment)

I've tested, and it seems like this solves issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: medium Issue or PR review is priority if no higher tasks exists type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant