Can you commit within a user-defined procedure?

procedure
(Clunny) #1

Is it possible to [periodically] commit within a user-defined procedure? If so, how do I do that?

In this case, I don't need to worry about the procedure being atomic and isolated in the ACID sense so I can commit regularly in order to release locks and improve concurrency.

I want to do this because I am creating many relationships in parallel from an application and there are some highly-connected nodes and I am facing delays due to locking on these nodes so I want to release these locks asap within the user-defined procedure.

P.S. I realise that any partially-executed transaction that is underway when this procedure gets called will then be committed by this procedure and that is also fine for me.

P.P.S. I'm open to suggestions to avoid contention on the highly connected nodes while creating many relationships in parallel.

Thanks,
Christopher

0 Likes