I have found the answer. We can set the expiry time for 1 minute as (60s in 
millisecs)

                     mcc.set(query1, crs,new Date (60000));

On Wednesday, August 1, 2012 10:33:16 AM UTC+5:30, Randeep wrote:
>
> Sorry forgot to mention that 2.0.1 is the danga client version and 
> memcached version is 1.4.3
>
> On Wednesday, August 1, 2012 10:31:36 AM UTC+5:30, Randeep wrote:
>>
>> Hi all,
>> I'm using version 2.0.1. It works fine for setting and getting when I'm 
>> not using expiry time. But when I add expiry time it is not working. My 
>> code is as follows.
>>
>>             Calendar cl = 
>> Calendar.getInstance(TimeZone.getTimeZone("Asia/Culcutta"));
>>           java.util.Date date = new 
>> java.util.Date(cl.getTime().getTime() + (5 * 60 * 1000));
>>           System.out.println("curr : "+ cl.getTime()+" date : "+ date);
>>           mcc.set(query1,crs, date);
>>
>> But the data get expired before 5 mins. Not even there for more than 1 
>> minute. Am I doing this in wrong way? Do you have any other methods?
>>
>

Reply via email to