Not lock runtime python #6312
Unanswered
leandrogmuller
asked this question in
Usage Questions
Replies: 1 comment 3 replies
-
Hi, I'm not sure why you would want to merge an object that's already in the session. See the documentation for details https://docs.sqlalchemy.org/en/14/orm/session_api.html?highlight=merge#sqlalchemy.orm.Session.expunge |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I need to execute merge, but not lock object during the process.
engine = create_engine("postgresql://user:pass@localhost:5432/datadev",poolclass=NullPool)
for i in range(3):
session_factory = sessionmaker(bind=engine)
session = session_factory()
lang03 = session.query(Lang03).filter(Lang03.pkge == 'kernel').first()
lang03.text = 'aa'
session.merge(lang03) #second attempt lock the code running. I dont't want lock the runtime.
Beta Was this translation helpful? Give feedback.
All reactions