finders do not work within Redis transaction

170 views
Skip to first unread message

Marcus Better

unread,
Sep 7, 2010, 5:54:32 AM9/7/10
to inconse...@googlegroups.com
Hi,

it seems my app is not able to use a dynamic finder within a
withTransaction block. Apparently interferes with the MULTI mode.

Code looks like:

User.withTransaction {
Foo.findByBar('bar')
}


2010-09-06 21:52:52,377 [http-8080-1] ERROR support.TransactionTemplate
- Application exception overridden by rollback exception
redis.clients.jedis.JedisException: Cannot use Jedis when in Multi.
Please use JedisTransaction instead.
at redis.clients.jedis.Jedis.checkIsInMulti(Jedis.java:540)
at redis.clients.jedis.Jedis.sort(Jedis.java:570)
at
org.springframework.datastore.redis.util.JedisTemplate$57.doInRedis(JedisTemplate.java:916)
at
org.springframework.datastore.redis.util.JedisTemplate$57.doInRedis(JedisTemplate.java:914)
at
org.springframework.datastore.redis.util.JedisTemplate.execute(JedisTemplate.java:106)
at
org.springframework.datastore.redis.util.JedisTemplate.sort(JedisTemplate.java:914)
at
org.springframework.datastore.redis.query.RedisQuery.paginateResults(RedisQuery.java:245)
at
org.springframework.datastore.redis.query.RedisQuery.executeQuery(RedisQuery.java:85)
at org.springframework.datastore.query.Query.list(Query.java:347)
at
org.grails.datastore.gorm.finders.FindByFinder.doInvokeInternalWithExpressions(FindByFinder.java:71)
at
org.grails.datastore.gorm.finders.DynamicFinder.invoke(DynamicFinder.java:171)
at
org.grails.datastore.gorm.finders.DynamicFinder.invoke(DynamicFinder.java:175)


Cheers,

Marcus

Graeme Rocher

unread,
Sep 7, 2010, 5:56:30 AM9/7/10
to inconse...@googlegroups.com
See http://grails.github.com/inconsequential/redis/manual/guide/5.%20Transactions.html

Read operations need to happen with a separate connection with Redis. It may be possible to one day detect the presence of a transaction and do a read with a separate connection, but that is not implemented yet

Cheers
Graeme

Reply all
Reply to author
Forward
0 new messages