Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to implement a transaction

Status
Not open for further replies.

avihaimar

Programmer
Jul 30, 2003
38
IL
Hey,

I want to implement transaction mechanism.

Think about world document each change saved in a temporal workspace and at the end the user can press on save and the changes apply to the original document or close and the document will not be changed.

My client can do a lot of changes to the configuration we need to save this changes in a temporal workspace (in order to mange the relation between records ... and in order to prevent lost of his work in case that the client crash)
At the end (he can do the changes for a week) he can choose apply changes that will merge those changes to the configuration or cancel.

So, i need to implement here something similar to transaction (i can use transaction because the client can do changes for a week).

does any one have an idea on how transaction implemented in DB?
any idea , references, article will be more than welcome.

Thank you
p.s - my application is in java.
 
what changes are you talking about? changes in the data or db model?
 
The client change the data but i have to persist those changes to the DB for the following reasons:
1. to get an id in oder to have the ability to manage those objects and the references between objects.
2. in order to not lost those changes in case that the server crash.
3. some data changes reflect on another objects, so i need to save this data to the DB.

Thank you
 
I am happy not to be aware of any work on db that could last for a week ;-)
but in that case if it's just for inserts - you could have a copy of the relevant live tables, let's call them pre-live, and save the changes there and after submiting move the data to live or have the live tables extended with a new flag(s) that can be used to determine which records have not been submited yet, of course you will need other new fields to save the processing user, generation id, ...
if you also want to change existing data, you should extend the previous using the "cvs like" :-D aproach with the check in/check out of existing records to ensure only one user works with specific records
there are of course more possibilities that could be used in your situation, maybe this helps you started
 
Thank you.

I need to support in update, delete...

and i can lock this records.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top