I have a collection of Long and for each element in the collection, I have to lookup a table in the database and do a select. The problem with this approach is that it just issues those many selects and every time there is a new connection being opened and when I make multiple calls to this method, the connection pool is exhausted too soon!
val allIds = Seq(1,2,3,4....)
for each id in allIds, I do:
db.run(fetchTableRowFromDb(_))
Is there a better way to avoid giving so many select statements?