Doubt about the connection

Good afternoon,

I have a problem of concept and would like to resolve it.

The connection C ++ Mysql is correct keep it open until the user close or do “logout”?

Or is it better to go by opening or closing? (I don’t see the functionality, it may work for some things like missions or other)

**Edited : **

Also : I would like information about multithreaded About EU4 chat, Async.