passing DB Connection object to methods

前端 未结 9 1752
抹茶落季
抹茶落季 2020-12-25 13:29

Was wondering if it is recomended to pass a database connection object around(to other modules) or let the method (in the other module) take care of setting it up. I am lea

9条回答
  •  不思量自难忘°
    2020-12-25 14:05

    Setting up the connection is potentially expensive and potentially adds a round trip. So, again, potentially, the better design is to pass the connection object.

    I say potentially, because if you are a Microsoft ADO app, you are probably using a connection pool....

提交回复
热议问题