Given that there is just one simple SQL statement (example: select id from foo
) that I need to execute on my Postgres 15 database, I am curious to know the performance impact of executing it using Play API's db.withTransaction
vs using db.withConnection
?
I suppose the former would be costlier since the database would need to start a transaction but I was hoping to get more details on the performance cost of using the former vs the latter.
withConnection
andwithTransaction
comes from play API for databases that gives you a jdbc connection. Then you can use the connection directly or you can use different libs such as anorm or slick. Without an specific case, is hard to say which approach has better performance