Closed GoogleCodeExporter closed 8 years ago
Console.WriteLine("test7 start");
var rc = new RedisClient("localhost", 6379);
var u = ServiceLayerContext.ServiceUsers.GetByID(8);
rc.Add("z", u.ToValueObject(), TimeSpan.FromSeconds(20));
var t = rc.GetById<Engine.BLL.DTO.User>("z");
Console.WriteLine(t.Dump());
this is also returns nothing;
Original comment by interes...@gmail.com
on 7 Jul 2010 at 3:17
however this one
Console.WriteLine("test7 start");
var rc = new RedisClient("localhost", 6379);
var u = ServiceLayerContext.ServiceUsers.GetByID(8);
rc.Add("z", u.ToValueObject(), TimeSpan.FromSeconds(20));
var t = rc.GetAll<Engine.BLL.DTO.User>();
Console.WriteLine(t.Dump());
where getByID is replaced with GetALL returns the data:
http://screencast.com/t/MDlmZTQ3Y
any ideas?
Original comment by interes...@gmail.com
on 7 Jul 2010 at 3:19
I'm trying to use the REDIS as cache layer in app.
Original comment by interes...@gmail.com
on 7 Jul 2010 at 3:20
Hey sorry its taken a while to respond, I just saw this issue now, looks like
we're operating in different time zones :)
Ok I think your problem is that 'GetById' looks for a property named 'Id' not
'ID'. Try changing the property name to 'Id' and give it another go.
Original comment by demis.be...@gmail.com
on 7 Jul 2010 at 7:36
You're right now it works. But still partially.
var rc = new RedisClient("localhost",
6379).GetTypedClient<Engine.BLL.DTO.User>();
var u = ServiceLayerContext.ServiceUsers.GetByID(8);
Console.WriteLine("Show what we have in DTO");
Console.WriteLine(u.ToValueObject().Dump());
Console.WriteLine("Save in Redis");
//rc.Store(u.ToValueObject());
rc.SetEntry("x", u.ToValueObject(),TimeSpan.FromSeconds(10));
Console.WriteLine("Getting from Redis");
var t = rc.GetAll();
//var t = rc.GetById("7");
Console.WriteLine("Dumping to show nothing extracted");
Console.WriteLine(t.Dump());
so opearatuin rc.Store(u.ToValueObject()); has worked. But then I tried
rc.SetEntry("x", u.toValueObject(), TimeSpan.FromSeconds(10)); and nothing has
been stored.
so how can I store the object that should be expired in 10 secs?
Original comment by dmitrys...@gmail.com
on 7 Jul 2010 at 10:08
also I'm curious why this one doesn't work
Console.WriteLine("test7 start");
var u = ServiceLayerContext.ServiceUsers.GetByID(6);
Console.WriteLine("Show what we have in DTO");
Console.WriteLine(u.ToValueObject().Dump());
Console.WriteLine("Save in Redis");
rc.Add("test2", u.ToValueObject(), TimeSpan.FromSeconds(20));
Console.WriteLine("Getting from Redis");
var t = rc.GetById<Engine.BLL.DTO.User>("test2");
Console.WriteLine("Dumping to show nothing extracted");
Console.WriteLine(t.Dump());
see what I get
http://screencast.com/t/ZjIwOTYzNTQ
rc.GetALL also produces zero result
Original comment by dmitrys...@gmail.com
on 7 Jul 2010 at 10:19
however the add/set operators seems to work:
http://screencast.com/t/YzIzZGYyMzkt
redis shows that I have data posted, but it seems none of GET method works.
Please clarify how to use the calls properly or if they aren't working (bug).
Original comment by dmitrys...@gmail.com
on 7 Jul 2010 at 10:22
Hi Dimitry,
Is it possible that 'Engine.BLL.DTO.User' is not the same type as
'u.ToValueObject()'?
Otherwise can you please submit a stand alone unit test or program so I can
tell you exactly why it doesn't work or what the expected behaviour should be?
- Demis
Original comment by demis.be...@gmail.com
on 7 Jul 2010 at 11:06
it seems it's working now. Thanks Demis for quick response.
Original comment by dmitrys...@gmail.com
on 8 Jul 2010 at 3:12
Cool, good to know!
Original comment by demis.be...@gmail.com
on 8 Jul 2010 at 7:46
Original issue reported on code.google.com by
interes...@gmail.com
on 7 Jul 2010 at 3:10