Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
| Author |
Topic |
|
vini83_4
Starting Member
2 Posts |
Posted - 2007-03-23 : 02:50:13
|
| Hi All,I have a situation where there are two tables Negotiation and Rubrics. A single negotiation can have N number of Rubrics. Hence it has Primary Key - Foreign Key relationship. Now I am using two different updatable recordset, to make changes from the form.The problem is with the close button we have in Negotiation Form. For example, a user says create negotiation and fills in d details in the Neg form, and adds several rubric to it (which opens a seperate rubric form). When each rubric is created and comes back to negotiation form, the record is actually updated in the database from the recordset. (Since Rubric is a different recordset).Now, When i say close from the Negotiation Form. The changes should not be committed or in other words, no changes should be committed, generally its should be rolled back to the original state. Since all the rubric info is already in the database, this is a problem.(hard to track wat all rubrics the negotiation had initially)I thought of maintaining a transaction in the db, but that wld need a single connection, which is not recommended.Please suggest us how this can be implemented.Thanks in advance. |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-03-23 : 06:40:13
|
| Not a good idea to hold a transaction on the database during user action - database transactions should be quick "in and out" type operations.How about a Flag Column on the record indicating that it is incomplete? and then if they press the CLOSE button that causes a Delete on the Database?Perhaps have a Date/Time column instead - set the date/time when the record is completed, clear that to NULL if the Rubric stuff is all saved as it should be, delete the record if the Date/Time is more than, say, 4 hours old (plus delete it when they press the CLOSE button - the after-4-hours cleanup will take care of anybody who's PC crashes whilst in the middle of the update process)Kristen |
 |
|
|
|
|
|
|
|