Transaction about redis and ormlite

Hi
Could i put Redis operator and sql operator in one transaction?

It’s sounds like business logic transaction. I want to assert Redis and sql success.

No of course not they’re 2 completely different server processes. Please also read up on Redis Transactions which are not like normal transactions i.e. they don’t rollback, they’re essentially just a mechanism to create atomic operations in Redis.

You’ll also want to read about how to create Redis Transactions with ServiceStack.Redis. Best you can do is check if the Redis Transaction was successful and either rollback or commit the DB transaction, e.g:

 if (redisTrans.Commit()) {
     dbTrans.Commit();
 }
 else {
     dbTrans.Rollback();
 }

Hi
Thanks for your answer.

I use AutoQuery to select data, but at the same time, i store a lot data in the Redis, is SS has solution to AutoQuery Redis?

No. Redis is a data-structure server and doesn’t support queries, this answer shows how you can create custom indexes.

Please take the time to learn about Redis.