I'm not able to get named/unamed dblink connections to persist in my springboot "java" (actually kotlin) application. I am writing my code in kotlin. The code looks like this.
var result = jdbcTemplate.queryForObject<String>("SELECT dblink_connect('myTestConnectionName'," + myCloudServerConnectionString + ");")
println(result) // prints "OK" meaning that it ran okay I believe.
var result2 = jdbcTemplate.queryForObject<String>("SELECT dblink_get_connections();")
println(result2) // prints "null" meaning there are no dblink connections.
I run the SQL manually in both PSQL and DBeaver and it works fine. I will see the named connection when I run "dblink_get_connections" sql. It only doesn't work in my springboot application.
Does anyone know what I can do to fix it?