JDBC connection query
heyo just a question, I’m just deployed my spring web first app on heroku, it connects to my neon tech db using jdbc. It work fine until the compute is suspended, as the connection to my app stops so throws exceptions when a request comes in. How do I deal with this? the connection is made in a dslContext config bean
2 Replies
flat-fuchsiaOP•2y ago
i guess how do i recover from an auto suspended
sunny-green•2y ago
Just noticed this here. Let's keep the chat here instead of in #💬|general
@XM2W seems like the JDBC needs to handle connection pooling or connection lifecycle better. There's probably some configuration properties you can set so the JDBC connection pool removes connections after 1-2 minutes of inactivity (before Neon suspends). When a new request comes in, it can create a new connection. I wrote about this concept here: https://neon.tech/blog/using-neons-auto-suspend-with-long-running-applications
Neon
Using Neon's Auto-Suspend with Long-Running Applications - Neon
We’re Neon, a cloud-native serverless Postgres solution. With Neon, your Postgres databases and environments are just one click away. You can still benefit from serverless Postgres if your application isn’t serverless. Try using Neon’s serverless Postgres with your long-running applications today. We refer to Neon as serverless Postgres because ...