> For the complete documentation index, see [llms.txt](https://coldbox.ortusbooks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://coldbox.ortusbooks.com/v4.x-1/the-basics/models/object-scopes.md).

# Object Scopes

You can very easily add persistence to your model+ objects via our annotations or binder configuration. The available scopes are:

* `transient or no scope` : The default scope. Meaning objects have no scope, they are recreated every single time you request them.
* `singleton` : Objects are created once and live until your Application expires
* `cachebox` : You can store your objects in any CacheBox provider and even provide timeouts for them
* `session` : Store them in the ColdFusion `session` scope
* `server` : Store them in the ColdFusion `server` scope
* `request` : Store them in the ColdFusion `request` scope
* `application` : Store them in the ColdFusion `application` scope
* `CUSTOM` : You can build your own scopes as well.

```javascript
// transient
component name="MyService"{}

// singleton
component name="MyService" singleton{}

// cache in default provider
component name="MyService" cache="true" cacheTimeout="45" cacheLastAccessTimeout="15"{}

// cache in another provider
component name="MyService" cachebox="MyProvider" cacheTimeout="45"{}

// request scope
component name="MyService" scope="request"{}

// session
component name="MyService" scope="session"{}
```

> **Hint** Pease note that using annotations is optional, you can configure every object in our configuration binder as well.

* Persistence DSL: <http://wirebox.ortusbooks.com/configuration/mapping-dsl/persistence-dsl>
* Object Persistence & Thread Safety: <http://wirebox.ortusbooks.com/advanced-topics/object-persistence-and-thread-safety>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://coldbox.ortusbooks.com/v4.x-1/the-basics/models/object-scopes.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
