var sidebar_align = 'right';
var content_container_margin = parseInt('290px');
var sidebar_width = parseInt('270px');
Unanswered: isolation in table with autogenerated primary key
I have two tables (T1 and T2) that it has like primary key to a field of type integer and identity. T2 has like foreing key the primary key of T1.
Appears the following process:
A first, inserted in T1 registry.
Second, I recover ID generated in T1 (SELECT IDENTITY_VAL_LOCAL() FROM SYSIBM.SYSDUMMY1).
Third, inserted one in T2 with ID generated of T1.
I want to know that isolation level must have my data base for this process.
Any isolation level will do (except UR) so long as all the statements are in the same UOW (Unit of Work) as defined by the commit statement (when all statements are completed).
The isolation level has more to do with applications that read data (and prevent others from updating until they are finishing reading the data) than it has to do with programs that update data.
Re: isolation in table with autogenerated primary key
You should not care about isolation level in this particular example.
The value of IDENTITY_VAL_LOCAL() is cached in the connection session context and stays there for at least until the end of unit of work(commit/rollback). No other transactions can change the value.