• Post Reply Bookmark Topic Watch Topic
  • New Topic

Transaction

 
Fernando Dominguez
Ranch Hand
Posts: 108
Debian Eclipse IDE Firefox Browser
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
I have a question.

If I begin a transaction, (I am doing it with java, but I omit the code)

1 - I insert a value in a table

2 - now I try to insert a value in another table, I need the value I have Inserted before in table 1 because there is a referencial integrity.

3 I don't commit yet,
Here is my question.

I can't see the values of any data (in a data browser) until I commit them
Is the step 2 seeing the data inserted in 1, or Is step 2 going to complain about referencial integrity because It don't see any data until it is commited

Thanks
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 35977
422
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Fernando,
Step 2 does see the update from step 1 because it is within the same transaction. It is other transactions that can't see the update from step 1.
 
Happiness is not a goal ... it's a by-product of a life well lived - Eleanor Roosevelt. Tiny ad:
the new thread boost feature: great for the advertiser and smooth for the coderanch user
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!