you likely want to use cx_oracle directly so that you can use callproc():

https://cx-oracle.readthedocs.io/en/latest/user_guide/plsql_execution.html


to access the cx_oracle cursor see the guidelines at 
https://docs.sqlalchemy.org/en/13/core/connections.html#calling-stored-procedures

you might get better results if you devise a stored proc that can accept 
multiple sets of parameters at once.  the cx_Oracle people are the best people 
to talk about regarding things like this, they actually work for Oracle: 
https://github.com/oracle/python-cx_Oracle/issues



On Wed, Oct 21, 2020, at 2:39 PM, Terrence-Monroe: Brannon wrote:
> 
> 
> On Wednesday, October 21, 2020 at 1:11:06 PM UTC-4 Terrence-Monroe: Brannon 
> wrote:
>> 
>> Question 2 - If we adopt a naive approach of opening a transaction, making 
>> 1000 calls to this stored proc that does simple inserts, and then commiting 
>> to database at the end of the 1000 calls to the stored proc, does this 
>> represent a bottleneck on database/computer resources of some sort, such as:
>> a - will multiple threads will be created for this?
>> 
>  
> I can answer this myself. Each separate call to the stored proc is sent to 
> the database immediately. So, there is no need for 1000 threads to remain 
> open until the commit is issued. The database does not actually commit the 
> data until the commit (if we are operating in that mode), but by no means is 
> Python/SQLAlchemy holding the transactions in limbo until the commit call.
> 
> 

> --
> SQLAlchemy - 
> The Python SQL Toolkit and Object Relational Mapper
>  
> http://www.sqlalchemy.org/
>  
> To post example code, please provide an MCVE: Minimal, Complete, and 
> Verifiable Example. See http://stackoverflow.com/help/mcve for a full 
> description.
> --- 
> You received this message because you are subscribed to the Google Groups 
> "sqlalchemy" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to [email protected].
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/3a39a538-9aae-4ac5-995b-8135956c69b7n%40googlegroups.com
>  
> <https://groups.google.com/d/msgid/sqlalchemy/3a39a538-9aae-4ac5-995b-8135956c69b7n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- 
SQLAlchemy - 
The Python SQL Toolkit and Object Relational Mapper

http://www.sqlalchemy.org/

To post example code, please provide an MCVE: Minimal, Complete, and Verifiable 
Example.  See  http://stackoverflow.com/help/mcve for a full description.
--- 
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/23d22c12-0de0-4030-9304-9fbe3deb50c3%40www.fastmail.com.

Reply via email to