Skip to content
This repository was archived by the owner on Dec 24, 2022. It is now read-only.

Commit 9b8e5f1

Browse files
committed
Update README.md
1 parent 89ff3af commit 9b8e5f1

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -796,6 +796,16 @@ This captures the Thread's StackTrace each time the client is resolved from the
796796

797797
If it does detect the client is being accessed from a different thread it will throw a `InvalidAccessException` with the message containing the different **Thread Ids** and the **original StackTrace** where the client was resolved from the pool. You can compare this with the StackTrace of the Exception to hopefully identify where the client is being improperly used.
798798

799+
#### Avoiding Concurrent Usage issues
800+
801+
What to look out for in your code-base to prevent against multiple concurrent usage of a `IRedisClient` instance:
802+
803+
- Use `IRedisClient` redis instance client within a `using` statement
804+
- Never use a client instance after it has been disposed
805+
- Never use (or return) a "server collection" (e.g. [Redis.Lists](#simple-example-using-redis-lists)) after the client has been disposed
806+
- Never keep a Singleton or `static` instance to a redis client (just the `IRedisClientsManager` factory)
807+
- Never use the same redis client in multiple threads, i.e. have each thread resolve their own client from the factory
808+
799809
## Copying
800810

801811
Since September 2013, ServiceStack source code is available under GNU Affero General Public License/FOSS License Exception, see license.txt in the source. Alternative commercial licensing is also available, see https://servicestack.net/pricing for details.

0 commit comments

Comments
 (0)