Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7601827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:15:29+00:00 2026-05-30T23:15:29+00:00

We are using SQLALchemy solely for the purpose of converting DB-independent code to sql

  • 0

We are using SQLALchemy solely for the purpose of converting DB-independent code to sql statements (through compile and explicit usage of dialect). We are not using the ORM in anyway, nor are we creating engines through create_engine.

I believe that using it this way does not make SQLA create any thread or db connection in the background. Is this true ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-30T23:15:30+00:00Added an answer on May 30, 2026 at 11:15 pm

    SQLAlchemy does not spawn threads, and will do everything within the thread a particular operation is invoked.

    The one place you can encounter synchronization-oriented quirks, even without spawning any threads, is in the pretty rare case that particular objects are garbage collected by Python’s GC cleanup thread. Such as if you worked with a Connection object, didn’t close it, and then let it fall out of scope, if it happens to be garbage collected by the gc thread you might see the DBAPI connection.rollback() method called in the GC, as SQLAlchemy cleans up connections when the garbage collector collects them. The solution to that issue, if the DBAPI is having issues with it, is to make sure you close out resources like Connection and Session objects proactively.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using sqlalchemy 6.0. The SQL Server T-SQL dialect seems to want to make
I am using SQLAlchemy and would like to log executed SQL code (i.e. the
I am using SQLAlchemy without the ORM, i.e. using hand-crafted SQL statements to directly
Hi im using sqlalchemy on a db2 table with 500k rows. using plain sql
I am using sqlalchemy with MySQL , and executing query with sql expression. When
I'm just using SQLAlchemy core, and cannot get the sql to allow me to
I have recently started using SQLALCHEMY to query a my-sql database. I want to
I have a simple code to fetch users from db using sqlalchemy and return
How I should set up this SQL database. I am using SQLAlchemy with SQLite.
How can I execute whole sql file into database using SQLAlchemy? There can be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.