sezaru

sezaru

SKIP LOCKED lock fails in Ash.Query

I have this Ash.Query in my code:

        CronJob
        |> Ash.Query.for_read(:due)
        |> Ash.Query.lock("FOR UPDATE SKIP LOCKED")
        |> Ash.read(authorize?: false)

When I run it, I get this error:

{:error,
 %Ash.Error.Invalid{
   errors: [
     %Ash.Error.Query.LockNotSupported{
       resource: Core.Jobs.CronJob,
       lock_type: "FOR UPDATE SKIP LOCKED",
       splode: Ash.Error,
       bread_crumbs: [],
       vars: [],
       path: [],
       stacktrace: #Splode.Stacktrace<>,
       class: :invalid
     }
   ]
 }}

But looking at AshPostgres code, it clearly has support for it here: ash_postgres/lib/data_layer.ex at f15ddb24948f81cf36bd89048b68ada8936fb8d1 · ash-project/ash_postgres · GitHub

Why is this failing? Shouldn’t it just work since AshPostgres has support for it?

Most Liked

sezaru

sezaru

Found the issue, the can? function is returning false when it shouldn’t, that’s a bug, so I created an issue here Locks are not correctly verified in `can?` function · Issue #703 · ash-project/ash_postgres · GitHub

Where Next?

Popular in Questions Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
jononomo
I am trying to figure out how Mix knows whether the environment is test, dev, or prod – where is this set? Thanks.
New
New
vonH
In asking this question I am more interested about the expressiveness of the language itself and less concerned about the availability of...
New
stefanchrobot
What’s the safe way to decode a JSON string into a struct? I want to avoid calling String.to_atom. Jason.decode can give me a map with st...
New
9mm
I am constructing a JSON object (map) and I need to conditionally set a field. I’m trying to write proper elixir-way code… and I’m at a l...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New

Other popular topics Top

vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
vonH
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
nsuchy
Hi. I’ve noticed that Windows Powershell has it’s own IEX command and you cannot access Elixir’s IEX due to the conflict. This isn’t a cr...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 49084 226
New
romenigld
I am trying to run a deploy with docker and I successfully runned with this command: docker build -t romenigld/blog-prod . but when I t...
New
senggen
Erlang/OTP 25 [erts-13.2.2] [source] [64-bit] [smp:8:8] [ds:8:8:10] [async-threads:1] 15:22:35.803 [error] gen_event {lager_file_backend...
New

We're in Beta

About us Mission Statement