Re: [hibernate-dev] Redis and TTL

2016-06-28 Thread Guillaume Smet
I might be dumb but I can't figure out a use case where you would want an external app to set a TTL and OGM to manipulate the same objects while keeping the TTL originally set. It really looks weird to me. Anyway, if it's really a use case, I think Gunnar's proposal does fit and will allow to

Re: [hibernate-dev] Redis and TTL

2016-06-28 Thread Mark Paluch
Hi Gunnar, see my responses in-line. Best regards, Mark > Am 28.06.2016 um 12:55 schrieb Gunnar Morling : > > Hi, > > > [...] The TTL is not configured in OGM for this use-case because the TTL > > might be determined somehow dynamic by the first client. > > Yes, but

Re: [hibernate-dev] Redis and TTL

2016-06-28 Thread Gunnar Morling
Hi, > [...] The TTL is not configured in OGM for this use-case because the TTL might be determined somehow dynamic by the first client. Yes, but this kind of issue is the crux when integrating different applications through the database. If you can't avoid it, you at least should use the same

Re: [hibernate-dev] Redis and TTL

2016-06-27 Thread Mark Paluch
There are many views on this problem. Let me borrow an example from Hibernate ORM: Databases were be shared amongst multiple applications and clients (I’m aware that this pattern is discouraged for many reasons) on several of my earlier projects. A lot of these projects used Hibernate ORM to

Re: [hibernate-dev] Redis and TTL

2016-06-27 Thread Mark Paluch
Hi Sanne, not sure I follow. The use case is: Two applications (clients) share one Redis instance. The first (non-OGM) client writes some data and sets an expiry (TTL). The second (OGM) client updates the data stored inside of Redis and preserves the remaining TTL. Note that the first

Re: [hibernate-dev] Redis and TTL

2016-06-27 Thread Guillaume Smet
Hi Mark! Thanks for commenting on this, I was hoping for it. While I can see the use case for sharing Redis data between 2 tools, I must admit that I find it a bit weird to set the TTL on one tool and store the entity on another one. It looks to me that if OGM stores the data, it has to manage

Re: [hibernate-dev] Redis and TTL

2016-06-27 Thread Mark Paluch
Hi Guillaume, TTL preservation behavior originates from Redis’ behavior and is to preserve interoperability: > http://redis.io/commands/set > Set key to hold the string value. [...] Any previous time to live associated > with the key is discarded on successful

Re: [hibernate-dev] Redis and TTL

2016-06-27 Thread Sanne Grinovero
Hi Mark, you wouldn't expect the timeout to be "reset" to some default value when your code writes to an entity? If you could explain the use case, that might help us to understand this. Thanks, Sanne On 27 June 2016 at 14:47, Mark Paluch wrote: > > Hi Guillaume, > > TTL

[hibernate-dev] Redis and TTL

2016-06-27 Thread Guillaume Smet
Hi, So, I'm currently working on reducing the number of calls issued to Redis in OGM as part of OGM-1064. At the moment, we execute a call to Redis to get the TTL already configured on an object before saving it. If the TTL is not explicitly configured with @TTL, we set this TTL again after