It's difficult to answer this question without knowing how your code
is structured. Are you reflecting your tables from the database, or
have you defined them statically?

What is the full stack trace when you get those errors?

Simon

On Wed, Mar 25, 2020 at 10:27 AM Javier Collado Jiménez
<collado...@gmail.com> wrote:
>
> Hello,
> I'm having a problem trying to cleanup sqlalchemy objects. My application has 
> a thread which handles DB connections. In some cases the thread dies and I 
> want to do a cleanup so, next time the thread is started it would be able to 
> reconnect again.
> The steps I tried are:
>             self.metadata.clear()
>             self.engine.dispose()
>             self.session.close()
>             self.conn.close()
> But when I start a new thread, errors like this appear:
> sqlalchemy.exc.ArgumentError: Column object 'column' already assigned to 
> Table 'table'
>
> --
> 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 sqlalchemy+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/sqlalchemy/74117457-9968-4aa2-afa3-8ccb91e86937%40googlegroups.com.

-- 
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 sqlalchemy+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/sqlalchemy/CAFHwexeUwzDhm1Hms7PfA752di6OmwG5BPoec5nfE6KKgw7D3g%40mail.gmail.com.

Reply via email to