liuhaipeng905 / servicestack

Automatically exported from code.google.com/p/servicestack
0 stars 1 forks source link

CreateTransaction failing when made as the first call #23

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hi Demis,

I'm starting to use the transaction support on RedisClient. I find when using 
the CreateTransaction function as the first call on the redis client 
(triggering connection) it fails with a 'no queued operation is currently set'.

This seems to be because straight after connect the client makes a call to get 
the version. This call happens after a transaction has been attached to the 
client but before the MULTI command has been sent.

I currently make a call to DbSize to force connection before any transaction 
calls but a transaction will still fail if it needs to reconnect.

Keep up the awesome work!

Thanks
Pete

Stack trace below.

System.InvalidOperationException : No queued operation is currently set
at ServiceStack.Redis.RedisTransaction.AssertCurrentOperation()
at ServiceStack.Redis.RedisTransaction.CompleteBytesQueuedCommand(Func`1 
bytesReadCommand)
at ServiceStack.Redis.RedisNativeClient.SendExpectData(Byte[][] 
cmdWithBinaryArgs)
at ServiceStack.Redis.RedisNativeClient.get_Info()
at ServiceStack.Redis.RedisNativeClient.get_IsPreVersion1_26()
at ServiceStack.Redis.RedisNativeClient.Connect()
at ServiceStack.Redis.RedisNativeClient.AssertConnectedSocket()
at ServiceStack.Redis.RedisNativeClient.SendCommand(Byte[][] cmdWithBinaryArgs)
at ServiceStack.Redis.RedisNativeClient.Multi()
at ServiceStack.Redis.RedisClient.CreateTransaction()

Original issue reported on code.google.com by townsend.pete on 22 Jul 2010 at 10:55

GoogleCodeExporter commented 9 years ago
Hey buddy I finally got around to fixing this. Although the latest version now 
serializes to JSON so you will need to flush your cache before deploying the 
new client. BTW I just released the Redis Admin UI which you guys might find 
useful, note it works with JSON so you'll need to look at a redis instance 
using new client:
http://www.servicestack.net/mythz_blog/?p=381

Original comment by demis.be...@gmail.com on 28 Aug 2010 at 5:25