# Persisting a MongoDB connection

**URL:** <https://community.temporal.io/t/persisting-a-mongodb-connection/8369>\
**Category:** Community Support\
**Tags:** database, typescript-sdk\
**Created:** [May 27, 2023, 3:02pm UTC](https://community.temporal.io/t/persisting-a-mongodb-connection/8369 "2023-05-27T15:02:55Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![nathan\_hyland](https://sea2.discourse-cdn.com/flex016/user_avatar/community.temporal.io/nathan_hyland/32/1054_2.png) [@nathan\_hyland](https://community.temporal.io/u/nathan_hyland)\
**Post date:** [May 27, 2023, 3:05pm UTC](https://community.temporal.io/t/persisting-a-mongodb-connection/8369/2 "2023-05-27T15:05:29Z")

</div>

Ah, actually it looks like you suggest holding the resource open via dependency injection: [Sharing Resources (e.g. DB connection) for Activities in Java](https://community.temporal.io/t/sharing-resources-e-g-db-connection-for-activities-in-java/966)

---

_[View the full topic](https://community.temporal.io/t/persisting-a-mongodb-connection/8369)._
