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

spring - jpa data support #126

Open
mamaorha opened this issue Jan 2, 2023 · 0 comments
Open

spring - jpa data support #126

mamaorha opened this issue Jan 2, 2023 · 0 comments

Comments

@mamaorha
Copy link

mamaorha commented Jan 2, 2023

I wasn't able to add jpa properly to the project, it works locally but when deployed there were missing beans and it kept on failing.
eventually i removed the jpa and defined the data source bean manually.

(note the System.getEnv is an additional hack since loading application.yaml isnt working as well - i opened a diff issue on that matter)

@Bean
    open fun dataSource(): DataSource {
        val hikariConfig = HikariConfig().apply {
            this.isAutoCommit = true
            this.driverClassName = "com.mysql.cj.jdbc.Driver"
            this.jdbcUrl = System.getenv()["MYSQL_HOST"]
            this.username = System.getenv()["MYSQL_USER"]
            this.password = System.getenv()["MYSQL_PASS"]
            this.connectionTimeout = 60000
            this.validationTimeout = 60000
            this.maximumPoolSize = 50
        }

        return HikariDataSource(hikariConfig)
    }
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