score:0

well, you never actually associate the new act with any gig - is that what is missing?

dbgig.acts.add(dbact);

or maybe:

dbact.gig = dbgig;

or something with the ids.

i.e. are you sure the act in the db is for the gig?

score:0

i had a similar issue, the problem / solution in my case was that the internal class that represented the database table was missing part of the primary key.

this appeared to work ok until the data from the db caused a primary key constraint in the code that the database was happy with.

pt

score:1

an alternative to gfrizzle's answer is unless you have a compelling reason to do so don't call submitchanges until after you have done all the db work.

score:2

try opening a fresh dbcontext at the beginning of this block. if you're using the same context for the first and second run, it won't see the inserted record the second time around. resetting the context should force it to see the latest rows in the table.


Related Query

More Query from same tag