Hi all,
I am facing a problem related to Ids management. My problem is:
A has many B I have a business key (B.key) in B which is a string equals to A.id + B.nb where nb starts from 1 and increment one by one. It means first B of A, second B of A...
I have problems creating B.id as I have problems incrementing B.nb. My problem is that I get max(B.nb) from DB and then add 1 but many times the latest B created was not yet flushed => I create many B with the same nb => the same B.key...
I am looking forward a solution to get a unique incemented nb from DB without flushing the entire object. Is it possible ? Can you give me examples of such a case ?
thanks a lot, Charles
|