aspose file tools*
The moose likes JDBC and the fly likes How DB actually works when needs to update a table? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » JDBC
Bookmark "How DB actually works when needs to update a table? " Watch "How DB actually works when needs to update a table? " New topic
Author

How DB actually works when needs to update a table?

Kevin Onik
Ranch Hand

Joined: Sep 10, 2003
Posts: 30
Hi there.

I'm new to DB and have a quastion.

How actually DB2 or Oracle works when you run a transaction which contains
for example 10 updates?

which one is correct?

1- copies the rows going to be updated to a temp space -->
writes the updates directly to the main table -->
if Commit happens -- > it's OK! and forgets the temp space
if Rollback happens --> rewrites the temp space to the original table

2- inserts the updates to a temp space -->
if Commit happens --> replaces the old rows in the table with new ones
if Rollback happens --> nothing going to do with the original table and forgets about the temp space

could anyone please describe it with a refrence from IBM or Oracle

Thank you in advance.


"The greatest pleasure in life is doing what people say you cannot do." --Walter Bagehot<p>SCJP 1.4<br />SCWCD 1.3</p>
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30780
    
157

Kamyar,
No updates are written to the main table right away. They are written to a file called a "rollback log" first.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How DB actually works when needs to update a table?