Updating Child and Parent at same time

  • Thread starter Thread starter SouthSpawn
  • Start date Start date
S

SouthSpawn

Hello Everyone,

I have a quick question.

Let's say you have the following situation. You have a parent table and a
child table. If I wanted to update both parent and child at the same time.
What would be the best way to do this. The reason why I am asking. Doing
two different inserts might be a bad idea. The reason being, what is the
first insert works, and the second one fail. If you have any suggestions
that would be great.

Thanks,
Mark
 
Not sure of your back-end technology, but the solution here is something
you might call a transaction. Transactions allow for failure situations to
result in a rollback to an original state.
 
You might want to check out a Document/View architecture. One document and
multiple views would give you what you're looking for.

GrkEngineer
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top