Skip to content
This repository has been archived by the owner on Feb 9, 2019. It is now read-only.

Redis Java 2.5.X #177

Open
djlitvak opened this issue Mar 2, 2017 · 0 comments
Open

Redis Java 2.5.X #177

djlitvak opened this issue Mar 2, 2017 · 0 comments

Comments

@djlitvak
Copy link

djlitvak commented Mar 2, 2017

Previously, I had a question in here regarding something I was running into. Instead, I am going to post the answer and ask a new question.

Using the Redis plugin on 2.5.x, I have added the injection of the JedisPool and declared a jedis class variable.

`
@Inject
JedisPool jedisPool;

Jedis jedis;
`

I have a method called "connect" that checks if jedis is null. If it is null, then it attempts to run jedis = jedisPool.getResource().

Currently, before any cache operation, I call the connect method.

I feel like this is overkill and wrong. Do you guys have any suggestions for how to manage this? Is there a way with Play 2.5.x and Java to use the CacheApi?

@djlitvak djlitvak changed the title Java 2.5.X Redis Java 2.5.X Mar 2, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant