Hi Ian, its really not biggie and once you move onto enterprise DB's its essential : check out Mr Horwith's excellent doc on the subject..
http://www.macromedia.com/devnet/mx/coldfusion/articles/cftransaction.html -----Original Message----- From: Ian Westbrook [mailto:[EMAIL PROTECTED] Sent: 14 July 2003 15:12 To: [EMAIL PROTECTED] Subject: Re: [ cf-dev ] SQL INSERT INTO anyone got a snippet of code to illustrate the <CFTRANSACTION... to put around the SELECT MAX(id) AS MAXID... code? I'm still using CFLOCK (type="exclusive") too... ta Ian W ----- Original Message ----- From: "Steve Martin" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Monday, July 14, 2003 3:06 PM Subject: RE: [ cf-dev ] SQL INSERT INTO If you're using SQL Server then @@identity is your friend anyway. In terms of the levels of locking supported by access, it doesn't really matter. A single transaction block is a single atomic set of instructions. The isolation levels determine how one transaction affects another when executed concurrently. > -----Original Message----- > From: Robertson-Ravo, Neil (RX) > [mailto:[EMAIL PROTECTED] > Sent: 14 July 2003 14:59 > To: '[EMAIL PROTECTED]' > Subject: RE: [ cf-dev ] SQL INSERT INTO > > > :-) > > I would check what level of DB locking is available to Access > via the Jet > engine and cftransaction - as I said, I havent used Access > for years but I > would assume that its fairly limited much like its feature set. > > If you really wanted to make sure...dump Access together and use an > enterprise level db which supports SP's! > > -----Original Message----- > From: Steve Martin [mailto:[EMAIL PROTECTED] > Sent: 14 July 2003 14:58 > To: [EMAIL PROTECTED] > Subject: RE: [ cf-dev ] SQL INSERT INTO > > > No, bung 'em in cftransaction, that's what it's for! > > > -----Original Message----- > > From: Robertson-Ravo, Neil (RX) > > [mailto:[EMAIL PROTECTED] > > Sent: 14 July 2003 14:56 > > To: '[EMAIL PROTECTED]' > > Subject: RE: [ cf-dev ] SQL INSERT INTO > > > > > > then bung em into a cflock..... > > > > -----Original Message----- > > From: Steve Martin [mailto:[EMAIL PROTECTED] > > Sent: 14 July 2003 14:57 > > To: [EMAIL PROTECTED] > > Subject: RE: [ cf-dev ] SQL INSERT INTO > > > > > > Like Adrian says, there is the possiblity for another > > transaction to sneak > > in between your first query and the select max... > CFTRANSACTION causes > > anything inbetween to be treated as an atomic Db transaction > > thus ensuring > > that the select max... is pulling out the record that was > created as a > > result of the insert in the same transaction block. > > > > > -----Original Message----- > > > From: Robertson-Ravo, Neil (RX) > > > [mailto:[EMAIL PROTECTED] > > > Sent: 14 July 2003 14:47 > > > To: '[EMAIL PROTECTED]' > > > Subject: RE: [ cf-dev ] SQL INSERT INTO > > > > > > > > > Erm...I dont think so, well not for Access anyway as I > > > (though I cant be > > > sure, as I havent used Access for donkey's) am not sure > > what level of > > > isolation it supports. > > > > > > It could do,as the Database engine itself should handle > > > locking. If you > > > want to be safe, I would say bung it in a cflock and be > > done with it. > > > > > > -----Original Message----- > > > From: Aidan Whitehall [mailto:[EMAIL PROTECTED] > > > Sent: 14 July 2003 14:41 > > > To: [EMAIL PROTECTED] > > > Subject: RE: [ cf-dev ] SQL INSERT INTO > > > > > > > > > > all cftransaction will allow > > > > you to do is rollback any changes should you pass in > > > crappy code for > > > the > > > > insert > > > > > > I thought, in this instance, where the possibility exists > > that another > > > user cause a simultaneous insert to occur, the > cftransaction ensured > > > that the MaxID value returned by the select was the value > previously > > > inserted in the preceding lines of code. Not so? > > > > > > > > > -- > > > Aidan Whitehall <mailto:[EMAIL PROTECTED]> > > > Macromedia ColdFusion Developer > > > Fairbanks Environmental Ltd +44 (0)1695 51775 > > > Queen's Awards Winner 2003 <http://www.fairbanks.co.uk/go/awards> > > > > > > ______________________________________________________________ > > > __________ > > > This e-mail has been scanned for all viruses by Star Internet. The > > > service is powered by MessageLabs. For more information on > > a proactive > > > anti-virus service working around the clock, around the > > globe, visit: > > > http://www.star.net.uk > > > ______________________________________________________________ > > > __________ > > > > > > -- > > > ** Archive: > http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > > > To unsubscribe, e-mail: [EMAIL PROTECTED] > > For additional commands, e-mail: [EMAIL PROTECTED] > > For human help, e-mail: [EMAIL PROTECTED] > > > > -- > > ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ > > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > For human help, e-mail: [EMAIL PROTECTED] > > -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED] -- ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/ To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] For human help, e-mail: [EMAIL PROTECTED]
