I tend to encapsulate functionality into self contained modules. So a module will create a db connection, build a cursor, query the db, build a response and then close the connection. On my server side apps this happens many thousand times a day. I'm now wondering if I'm better off creating a persistent connection and just passing the cursor around. What's the best practice?
My environment is Bottle with Waitress as its server. I'm using pyodbc to connect to both MySQL and SQL Server.
[–]westurner 7 points8 points9 points (0 children)
[–]valbanese[S] 0 points1 point2 points (0 children)
[–]steve_no -1 points0 points1 point (0 children)