# Session In View Query Detected

<figure><img src="/files/p8WZHEBuEYvudEP9eCxk" alt=""><figcaption></figcaption></figure>

### Description

Open Session in View is an anti-pattern in which the view rendering stage triggers DB calls because of lazy properties initialization. It is recommended to pass DTOs to the view and avoid hitting the DB.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.digma.ai/digma-developer-guide/digma-features/insights/session-in-view-query-detected.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
