Thanks That makes sense - that all the locks would be kept until the transend.
Regards Simon Simon Verona -------- Original message -------- Subject: Re: Transactions From: John Watson <[email protected]> To: jBASE <[email protected]> CC: Hi, The assumption is that process would need to lock all records within the transaction boundary - hence process 2 would not be able to increment the sequence parameter file. The locks will be maintained until the TRANSEND and only released when the transaction is finalised - the lock will not be released with the WRITE function. This can present all sorts of issues for multi-threaded processing and there is a need to keep a transaction boundary as efficient as possible (although sods law means that the larger the boundary the more efficient the final write!) John. On May 4, 11:11 am, Simon Verona <[email protected]> wrote: > Hi > > I am about to embark on using "Transactions" (ie transstart and > transend) in my application to maintain database integrity. > > I have a question relating to how transactions work, and thought it > would be an easy answer rather than me constructing a test. > > If I have a routine that updates a file with sequential ids - ie > 1000,1001,1002 etc using a parameter which contains the next id no, and > there are other routines that are running simultaneously what happens if > the routine within the transaction aborts and has to rollback? > > For example.. > > If my next id parameter starts off at 1000. My subroutine within the > transaction writes up 3 records, 1000,1001,1002 and moves the parameter > to 1003. Meanwhile, whilst the rest of the transaction is processing > another process writes a record, moving the parameter to 1004. If the > first transaction then aborts what is left in the parameter ? I know > that the transactions themselves will disappear. > > Many thanks in advance > > Regards > Simon > > -- > ======================================= > Simon Verona > Director > Dealer Management Services Ltd > T: 0845 686 2300 > ======================================== -- IMPORTANT: T24/Globus posts are no longer accepted on this forum. To post, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jBASE?hl=en -- IMPORTANT: T24/Globus posts are no longer accepted on this forum. To post, send email to [email protected] To unsubscribe, send email to [email protected] For more options, visit this group at http://groups.google.com/group/jBASE?hl=en
