I have two worries (or misunderstandings) about such component.
If the db connection is created on start and close on stop, does it mean that during life of my web application (it can be quite long) I have always one connection opened? What would happen when two separate threats would use such connection?
Could you suggest me how could I rewrite this code to add a db connection pooling? For your info, I use Postgresql db.
You can use a Clojure wrapper for HikariCP, a JDBC connection pool. The off-the-shelf component available in org.danielsz/system can help you save a bit of boilerplate code.
I use Mount instead of Component, but that Hikari-CP solution is the same solution I use. Much better with PostGres than MySQL, btw. MySQL has proven pretty flaky and tough to work with for me so far.