Re: [sqlalchemy] Non-repeatable reads, vectorized refresh

2022-08-23 Thread Mike Bayer
On Tue, Aug 23, 2022, at 3:00 PM, Evgenii wrote: > > Thanks a lot! > I used “vectorized” for sqlalchemy.orm.Session.refresh method and mean that > it would be nice to use: > > `session.refresh(instances_list) ` > that make a single query to database. Instead of: > do this:

Re: [sqlalchemy] Non-repeatable reads, vectorized refresh

2022-08-23 Thread Evgenii
Thanks a lot! I used “vectorized” for sqlalchemy.orm.Session.refresh method and mean that it would be nice to use: session.refresh(instances_list) that make a single query to database. Instead of: for el in instances_list: session.refresh(el) that make N queries. like: res =

Re: [sqlalchemy] database operation fails after succsefull multi-processing.

2022-08-23 Thread Geert Jan Talens
For my purposes I'm perfectly happy to use pymysql instead of mysqldb, but I'll gladly help with further debugging if you wish to chase this down. Here's the output for the python session: Python 3.9.7 (default, Sep 16 2021, 13:09:58) [GCC 7.5.0] :: Anaconda, Inc. on linux Type "help",

Re: [sqlalchemy] Non-repeatable reads, vectorized refresh

2022-08-23 Thread Mike Bayer
On Tue, Aug 23, 2022, at 1:50 PM, Evgenii wrote: > Hi there! > > > > Please help me to understand: > I want to make two equal queries, that sends real queries to database each > time: > > > `session.query(InstrumentTable).get(instr_id) > > session.query(InstrumentTable).get(instr_id) ` >

Re: [sqlalchemy] How to Warm Up Connection Pool ?

2022-08-23 Thread Mike Bayer
On Tue, Aug 23, 2022, at 1:54 PM, mkmo...@gmail.com wrote: > As stated in the docs: > > > All SQLAlchemy pool implementations have in common that none of them “pre > > create” connections - all implementations wait until first use before > > creating a connection > > Is it possible to warm

Re: [sqlalchemy] database operation fails after succsefull multi-processing.

2022-08-23 Thread Mike Bayer
okey doke let's see what mysql client library you are running, here's a Python session that locates the .so file in use and then runs the ldd command, which can give us a clue what you are running, if pymysql has no issue then we need to suspect client library as a possible factor. $ python

[sqlalchemy] How to Warm Up Connection Pool ?

2022-08-23 Thread mkmo...@gmail.com
As stated in the docs: > All SQLAlchemy pool implementations have in common that none of them “pre create” connections - all implementations wait until first use before creating a connection Is it possible to warm up, or pre create, the connections in the pool? When I start my server, the

[sqlalchemy] Non-repeatable reads, vectorized refresh

2022-08-23 Thread Evgenii
Hi there! Please help me to understand: I want to make two equal queries, that sends real queries to database each time: session.query(InstrumentTable).get(instr_id) session.query(InstrumentTable).get(instr_id) The problem is that second query returns instance from identity_map. I know how

Re: [sqlalchemy] database operation fails after succsefull multi-processing.

2022-08-23 Thread Geert Jan Talens
It does happen on every run. I'm not entirely sure how to run it on a different server, I'm fairly new to databases. I'm running "mysql Ver 8.0.30 for Linux on x86_64 (MySQL Community Server - GPL)". The issue does not occur when using pymysql. On Tuesday, 23 August 2022 at 12:05:24 UTC-4

[sqlalchemy] Re: Filling up a field in a database from a text file, flask

2022-08-23 Thread Siarhei Siarhei
It's not Flash, but it's close.. https://github.com/wnesbv/starlette-admin-auth-blog-booking/blob/main/item/schedule_export_csv.py https://github.com/wnesbv/starlette-admin-auth-blog-booking/blob/main/item/schedule_import_csv.py понедельник, 22 августа 2022 г. в 18:00:48 UTC+3, Jonathan Vanasco:

Re: [sqlalchemy] database operation fails after succsefull multi-processing.

2022-08-23 Thread Mike Bayer
also try the pymysql DBAPI if that changes things, if this is mariadb try mariadb-connector also. On Tue, Aug 23, 2022, at 12:04 PM, Mike Bayer wrote: > it happens every time the program is run? there's nothing really going on > in the program here, if I take out the initializer, then the

Re: [sqlalchemy] database operation fails after succsefull multi-processing.

2022-08-23 Thread Mike Bayer
it happens every time the program is run? there's nothing really going on in the program here, if I take out the initializer, then the program produces lots of stack traces as expected, but even then not the "server has gone away" error. can you try running on a different MySQL /MariaDB

Re: [sqlalchemy] database operation fails after succsefull multi-processing.

2022-08-23 Thread Geert Jan Talens
Hello Mike, Thank you for your reply. The traceback of the issue is below. I'm using sqlalchemy 1.4.40 and MySQLdb 2.1.1, the problem does not occur when using sqlite for the database instead. Regards, Geert Jan Traceback (most recent call last): File