Python Forum
Using SQLAlchemy, prevent SQLite3 table update by multiple program instances
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using SQLAlchemy, prevent SQLite3 table update by multiple program instances
#4
I found the bug causing my issue. It wasn't with the code I shared. It was a fault in how I was cleaning up the connections when I was done with them.

When my code was finished with a connection, it would make a call to agent.disconnect(), which decremented the connection counter. Later, Python would delete the agent object and part of that process was also to call agent.disconnect(). This resulted in my counter going down by two instead of one when I was finished with the connection.

I now ensure that I have a connection before I do a disconnect.
Reply


Messages In This Thread
RE: Using SQLAlchemy, prevent SQLite3 table update by multiple program instances - by Calab - Aug-09-2023, 05:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Rows not adding to sqlite3 database using SQLAlchemy Calab 11 1,831 Jun-02-2023, 05:53 PM
Last Post: bowlofred
  extract table from multiple pages sshree43 8 5,416 Dec-12-2022, 10:34 AM
Last Post: arvin
  Multiprocessing Pool Multiple Instances How to Kill by Pool ID sunny9495 0 784 Nov-16-2022, 05:57 AM
Last Post: sunny9495
  Python: re.findall to find multiple instances don't work but search worked Secret 1 1,246 Aug-30-2022, 08:40 PM
Last Post: deanhystad
Smile How we can prevent screen recording murad_ali 3 1,877 Jul-29-2022, 10:29 AM
Last Post: DeaD_EyE
  sqlalchemy could not find table 3lnyn0 4 6,762 Mar-30-2022, 12:36 PM
Last Post: Larz60+
  How to prevent python from going to new line in for loop? idknuttin 3 4,988 Feb-11-2022, 05:40 AM
Last Post: deanhystad
  How do you format Update statement with multiple conditions hammer 4 2,157 Dec-16-2021, 10:49 PM
Last Post: hammer
  SQLALCHEMY - Not selecting data from table jamesaarr 4 2,277 Nov-02-2021, 03:02 PM
Last Post: Larz60+
  Slittping table into Multiple tables by rows drunkenneo 1 2,096 Oct-06-2021, 03:17 PM
Last Post: snippsat

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020