Hi, I have thought about the following SQL statements:
INSERT INTO A(a1, a2)
SELECT b1, udf_SomeFunc(b1)
FROM B
Where udf_SomeFunc makes a select on table A. As I understand, first, a shared lock is set on A (I am talking just about table A now), then, after this lock is released, an exclusive lock is obtained to insert the data. The question is: is it possible, that another transaction will get the exclusive lock on table A, just before the current transaction takes its exclusive lok on A?