Barry,

Without sounding rude on this, I am no novice to CF so I'll let the newbie's
read the extra stuff you posted. All I wanted to know is that if I do this

<cfquery>
 insert into sometable (somevalue) values (data)
 select @@Identity as RecordId
</cfquery>

Would it actually be run as one query, if this is then I wouldn't need to do
a serialiazable on the transaction in this case. Otherwise you are posting
too much information that I already am aware off!!

But hey still insightful:-)

 
Regards
Andrew Scott
Technical Consultant

NuSphere Pty Ltd
Level 2/33 Bank Street
South Melbourne, Victoria, 3205

Phone: 03 9686 0485  -  Fax: 03 9699 7976


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Barry Beattie
Sent: Thursday, 29 July 2004 11:36 AM
To: CFAussie Mailing List
Subject: [cfaussie] RE: CFTransaction and CFC's

IMHO, for an "insert parent Record" + "get @@identity" + "insert child
records", any isolation type would be fine. it's being under the umbrella of
a transaction that matters. return the @@identity, store in a variable and
use that for the life of the process (the transaction)

actually, on second thoughts, "SELECT @@identity from tablename" is designed
for returning autonumbers after insert (but you can only do it once). I
mean, what's the alternative? "select Max(autonumberField) from tablename"? 

how can you trust that someone else doing an insert has got the same
"Max(autonumberField)" because their thread also did that query before your
thread could do anything about it. "isolation=serializable" is sounding
better all the time...

One thing to keep in mind is that CF is a multi-threaded webserver (LOL!
is there any othertype?). cftransaction is a way of controlling which
threads are accessing the db at any one time.

Imagine three queries one after the other. it looks like big one block of
code. But the way the CPU executes the commands, it's as if 1000 lines of
code are between each cfquery with the other 900 lines executed under the
context of diferent users.

Additionally, if it was an update with multiple steps then I'd definatly
pick the strongest isolation possible.

if this was SQLServer you could put all the SQL in one cfquery seperated by
";" and bypass the whole issue but MSAccess/Jet db can't do that so separate
query blocks it is.

well, that's pretty much all I know about cftransaction (I've forgoten the
rest at the moment...).

as I said earlier, if anyone has additional info or corrections please speak
up (no, they're all busy hasseling Taco or Steve Onnis - go
figure!)

good luck Andrew

cheers
barry.b


---
You are currently subscribed to cfaussie as: [EMAIL PROTECTED]
To unsubscribe send a blank email to [EMAIL PROTECTED]
Aussie Macromedia Developers: http://lists.daemon.com.au/

Reply via email to