I'm getting this error Cannot open a new connection because existing connection is still on current thread
after a while. I think the error is pretty self explanatory. My code is this:
String mySQLUrl = "jdbc:postgresql://" + dataLayer.PostgreSQL_Host + "/" + dataLayer.PostgreSQL_Database;
Base.open("org.postgresql.Driver", mySQLUrl, dataLayer.getPostgreSQLUser(), dataLayer.getPostgreSQLPassword());
In order to avoid that error, i would like to create a connection factory, but to accomplish this, i need to know how to verify if there's a connection opened (and still valid) and return it, otherwise, create it. Is there something built or should i use the good old try-catch? :|