Exception in thread "task-2" org.springframework.jdbc.datasource.init.UncategorizedScriptException: Failed to execute database script; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionException: Failed to obtain JDBC Connection; nested exception is java.sql.SQLException: HikariDataSource HikariDataSource (HikariPool-1) has been closed.
I have an SQL script that just inserts some records on app start
spring.datasource.data=classpath:kana.sql
It seems to run through about 10-20 just fine and then suddenly it quits
My application.properties:
## default connection pool
spring.datasource.hikari.connectionTimeout=20000
spring.datasource.hikari.maximumPoolSize=5
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create
## PostgreSQL
spring.datasource.url=jdbc:postgresql://10.0.0.100:5432/langsite
spring.datasource.username=postgres
spring.datasource.password=postgres
spring.datasource.driverClassName=org.postgresql.Driver
spring.datasource.initialization-mode=always
spring.datasource.data=classpath:kana.sql
server.port=4000
#drop n create table again, good for testing, comment this in production
# javax.persistence.schema-generation.scripts.action=create
# javax.persistence.schema-generation.create-source=metadata
# javax.persistence.schema-generation.drop-source=metadata
It seems to connect successfully initially, because it can create the tables, insert a few records, but then part-way through the insertions it just craps out.