Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Transaction

 
Fernando Dominguez
Ranch Hand
Posts: 104
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
Marshal
Posts: 34071
331
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic