---
title: "Comment by Mahmudul Hassan on \"Patterns and Practices for using SQLAlchemy 2.0 with FastAPI\" | Hashnode"
description: "hey thanks for the article . One question : you add await session.commit() in both get_db_session function also in router method like create_ingredient . can yo"
url: "https://hashnode.com/posts/fastapi-sqlalchemy/648b2aeb8a365cbd5dbe45f9/comment/66f91df4e98dcdf683e56e5d"
---

[Discussion](https://hashnode.com/posts/fastapi-sqlalchemy/648b2aeb8a365cbd5dbe45f9)

Comment [Patterns and Practices for using SQLAlchemy 2.0 with FastAPI](https://hashnode.com/posts/fastapi-sqlalchemy/648b2aeb8a365cbd5dbe45f9)

[Mahmudul Hassan](https://hashnode.com/@mahmudul5809)

[Sep 29, 2024](https://hashnode.com/posts/fastapi-sqlalchemy/648b2aeb8a365cbd5dbe45f9/comment/66f91df4e98dcdf683e56e5d)

hey thanks for the article . One question :

you add await session.commit() in both get\_db\_session function also in router method like create\_ingredient . can you explain this please? Thanks
