Ask a question about how to use dbutils for python.

Hello, everyone. I"ve been looking at connection pooling recently, and then I used python"s dbutils. Here"s a problem. Connection pooling is to keep the connection all the time, in order to speed up, but some online tutorials still cursor.close () conn.close () after using commit each time. What on earth are these two close shutting down? is it to disconnect the user from the mysql, or just to release the current connection in the connection pool for other users to use again? No, whether close is OK or not. I don"t have a clear understanding of this area. I hope I can correct it. Thank you

Nov.20,2021

  1. sometimes close is not allowed, while others must be close
  2. what close might do

    • close does nothing , that's right. PersistentDB's close method is really good, and it doesn't matter if it's not close.
    • close puts proprietary connections back into the connection pool (connections are not usually closed), pool.dedicated_connection () . The db of this function must be close
  3. so: don't worry, close, keep good habits after you use it.
MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e476a1-665d2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e476a1-665d2.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?