Klitos Kyriacou
03/03/2022, 12:16 PMDataSource
has a method getConnection()
which creates a new Connection
every time it's called. Is it therefore better to write
val connection = dataSource.getConnection()
rather than
val connection = dataSource.connection
?Joffrey
03/03/2022, 12:17 PMgetConnection()
, how about connect()
? It makes it pretty clear that a new connection is created when using the verb, and it also happens to be shorterJoffrey
03/03/2022, 12:19 PMDataSource.connect()
to avoid IDEA warnings and make it clearer at the same time 😄ephemient
03/03/2022, 10:32 PMopenConnection()
may be a better name, since it more clearly indicates that the result can .close()
ephemient
03/03/2022, 10:33 PM