FastAPI - Database Integration
Consider this FastAPI route using a database session dependency:
```python
def get_db():
db = SessionLocal()
try:
yield db
finally:
db.close()
@app.get('/products/{product_id}')
async def read_product(product_id: int, db: Session = Depends(get_db)):
product = db.query(Product).filter(Product.id == product_id).first()
return product
```
What will happen if the database session is managed as shown?
