Skip to content

bypassing record_cache when selecting rows with lock #2

Closed
@dhruvg

Description

Hi,
Thanks for sharing record-cache, it is pretty solid.

I am tinkering around with it and I notice that record cache seems to hit the cache even when I want to retrieve rows with a lock. Example:

transaction do
Item.lock("lock in share mode").where(:conditions).each do |i|
...
end
end

When I look at my SQL logs, I only see:
BEGIN
COMMIT

The actual select query is not there. When I disable record_cache and do the same thing again, the select query is there as expected. So it makes me believe that record cache is retrieving from cache even though I want to lock the rows in the db.

What would be the best way to get around this, so for any lock selects, record-cache is bypassed?

Thanks!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions