# clear

Clear the session removes all the entities that are loaded or created in the session. This clears the first level cache and removes the objects that are not yet saved to the database.

## Returns

* This function returns the base service reference (`this`)

## Arguments

| Key        | Type   | Required | Default | Description                            |
| ---------- | ------ | -------- | ------- | -------------------------------------- |
| datasource | string | false    | ---     | The default or specific datasource use |

## Examples

```javascript
ormService.clear();
```


---

# 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://coldbox-orm.ortusbooks.com/base-orm-service/service-methods/orm-session/clear.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.
