# C# Driver Exception : Failed to acquire a connection from connection pool

**URL:** <https://community.neo4j.com/t/c-driver-exception-failed-to-acquire-a-connection-from-connection-pool/59519>\
**Category:** Drivers & Stacks\
**Tags:** migrated\
**Created:** [September 15, 2022, 7:56am UTC](https://community.neo4j.com/t/c-driver-exception-failed-to-acquire-a-connection-from-connection-pool/59519 "2022-09-15T07:56:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ramesh\_yadav](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/ramesh_yadav/32/3859_2.png) [@ramesh\_yadav](https://community.neo4j.com/u/ramesh_yadav)\
**Post date:** [September 15, 2022, 7:56am UTC](https://community.neo4j.com/t/c-driver-exception-failed-to-acquire-a-connection-from-connection-pool/59519/1 "2022-09-15T07:56:36Z")

</div>

We are using the .net driver to connect Neo4j AURA DB hosted on the Neo4j cloud. After some time of connectivity, we are getting below exception from the driver.

**Neo4j.Driver.ClientException: Failed to acquire a connection from connection pool for server with URI `'' as this server has already been removed from routing table. Please retry your query again and you should be routed with a different server from the new routing table. You should not see this error persistently.**

Below is the code used to create the driver and the multiple driver instances are used in the application.

```auto
GraphDatabase.Driver(_serverUrl, AuthTokens.Basic(_username, _password), o =>
{
 o.WithSocketKeepAliveEnabled(true)
.WithMaxConnectionLifetime(TimeSpan.MaxValue);
});

```

---

<div class="post-metadata">

**Author:** ![grant\_lodge](https://sea1.discourse-cdn.com/flex021/user_avatar/community.neo4j.com/grant_lodge/32/21665_2.png) [@grant\_lodge](https://community.neo4j.com/u/grant_lodge)\
**Post date:** [September 20, 2022, 8:14am UTC](https://community.neo4j.com/t/c-driver-exception-failed-to-acquire-a-connection-from-connection-pool/59519/2 "2022-09-20T08:14:54Z")

</div>

Hello, As aura is a dynamic environment your instances can be upgraded or moved to a new machine etc, you can't rely on the connections to stay alive indefinitely.

This error should only be seen if using Session.Run/RunAsync to issue queries.

Best practices when working with Aura are to use:  
Session.ReadTransactionAsync(Driver v4.X) /Session.ExecuteReadAsync(Driver v5+) Session.WriteTransactionAsync(Driver v4.X)/Session.ExecuteWriteAsync(Driver v5+).  
These will attempt to handle the update of a routing table without propagating an error to a user.
