How to execute subtransactions #6325
Unanswered
leandrogmuller
asked this question in
Usage Questions
Replies: 1 comment 1 reply
-
Hi, Can you please provide a complete example? What does not work? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi.
How can I execute subtransactions?
Example below not work.
engine = create_engine("postgresql://user:pass@localhost:5432/datadev",poolclass=NullPool)
session_factory = sessionmaker(bind=engine)
session = session_factory()
session.begin_nested() # when uses it dons't commit.
lang03 = session.query(Lang03).filter(Lang03.pkge == 'kernel').first()
lang03.text = 'aa'
session.merge(lang03)
session.commit()
session.close()
Beta Was this translation helpful? Give feedback.
All reactions