William wrote:
when you DON'T specify that setting. LLBLGen Pro will use a NEXTVAL call on the sequence before the insert statement. This value is then used to insert the row. Your trigger is executed then, and also does a NEXTVAL and inserts that value into the row instead. The value LLBLGen pro knows isn't valid anymore, so reading back the entity won't work: the ID isn't found.
When you specify that setting, LLBLGen pro will use a CURRVAL call to the sequence After the insert, and the id is then thus the same as the one inserted by the trigger.
I'm sorry I'm lost.
With the app.config setting and just saving the parent entity 'user' then the row is inserted in the DB with the correct PK value for IDUser and I can get that value returned correctly in code. Everything is fine.
But when I try to insert a parent AND child entity using the app.config setting, you're saying that the trigger assigns the NEXTVAL and LLBL throws the value away before assigning the IDUser value to the child entity 'userRole'?
Why does the app.config setting work with just a parent entity but not the parent and child?
William
So you're saying with the app.config setting the recursive save still doesn't work? (I haven't read the whole thread in depth, I'll do that now)
(edit). It's indeed strange, as you don't specify a refetch (you just call SaveEntity(), which specifies false for refetch, so the save of the parent always succeeds if there's no error, so the sync will go ok.
I have no problems saving entities in oracle in my unittests, also hierarchies like you do.
One question for you: the relation userrole -> user, is that relation hidden? (or the field on the relation, is that one hidden?)
I.o.w., if you do:
userrole.User = user;
is that possible or do you get a compile error?