Home » Java » Reconnecting to database with Java Play Ebeans

Reconnecting to database with Java Play Ebeans

Posted by: admin October 26, 2017 Leave a comment


I am using Ebeans in my Java Play application to connect to a MS SQL instance. Below is how my configs in application.conf look.

db {
 default {
  password="[email protected]",

Now when the connectivity drops in the middle its re-connecting. But when database connectivity is down at startup, it doesn’t reconnect even though database comes up later.There are no logs showing any reconnect attempts as well. What should I do in my config or code to achieve that? I am using Play 2.4.2 with E-Beans version 4.0.2. Any help would be much appreciated.