Scala : Explicit connection handling