I'm using Spark to create a rest API.
also I'm using ormLite + mysql database for persistent database.
now the question is when should i close the connection to the database ?
or should i close the connection after each request ?
This is how I'm connecting to the database :
JdbcConnectionSource connectionSource = JdbcConnectionSource(databaseUrl);
connectionSource.setUsername("myUsername");
connectionSource.setPassword("myPassword");