[Python] Connection pool in oracle python is taking a lot of time to execute insert/update...

Discussão em 'Python' iniciado por Stack, Setembro 9, 2025.

  1. Stack

    Stack Membro Participativo

    self.connection = oracledb.create_pool(
    protocol=self.protocol,
    host=self.host,
    port=self.port,
    service_name=self.service_name,
    ssl_server_cert_dn=self.ssl_server_cert_dn,
    user=self.username,
    password=self.password,
    min=0,
    max=50,
    expire_time=60
    )
    print("- Connected to the database.")

    def _get_connection(self):
    if not self.connection:
    self.connect()
    return self.connection.acquire()

    def executemany_update(self, sql, params_list, label=None):
    if not params_list:
    return 0
    label = label or 'executemany'
    with self._get_connection() as conn:
    with conn.cursor() as cur:
    print(f"[SQL] {label}: executing {len(params_list)} records…")
    cur.executemany(sql, params_list)
    conn.commit()
    print(f"[SQL] {label}: completed and COMMIT applied.")
    return len(params_list)


    Hello, I am using Connection pool: The bulk insert/update is taking minutes to run even for 200 records, how do I make this efficient to run within seconds?

    Continue reading...

Compartilhe esta Página