My application uses a singleton connection of redis everywhere, it's initialized at the startup.
My understanding of MULTI.EXEC()
tells that all my WATCHed
keys would be UNWATCHed
when the MULTI.EXEC()
is called anywhere in the application.
This would mean that all keys WATCHed
irrespective of which MULTI
block they were WATCHed
for will be unwatched, beating the whole purpose of WATCHing
them.
- Is my understanding correct?
- How do I avoid this situation, should I create a new connection for each transaction?