Jochem,
Ok you threw me.... To summarize what you are saying:
FIRST: User "A" does the following:
SELECT * FROM users WHERE username = 'bob'
WITH (updlock)
.... Presumably User "A" is now looking at Bob's information for editing
on a web page
SECOND: Meanwhile User "B" runs the same query
SELECT * FROM users WHERE username = 'bob'
WITH (updlock)
... What happens here? Does the JDBC throw an error?
.... How would we be able to determine (using SQL) that the record is
indeed locked for updating without would we have to trap a specific error
perhaps?
THIRD: Finally, User "A" is done and decides she
1) Wants to update the record ... So she runs
UPDATE users SET name = 'bob smith'
WHERE username = 'bob'
... Is this update sufficient to release the lock?
... Since JDBC will draw a connection from the connection pool - how
will the database know that this update is the same user that locked the
record previously? Wouldn't we have to use individual usernames/permissions
for the DB to make that work?
... Should this query run an explicit commit and if so what's the
syntax?
...OR....
2) She decides that she doesn't want to do an update and cancels out
or closes the page.
... How would we go about releasing this specific lock?
... You say "COMMIT" clears out all the locks .. So if I do
a...
<cfquery name="commit" datasource="myDsn">
COMMIT
</cfquery>
...or..
<cfquery name="rollback" datasource="myDsn">
ROLLBACK
</cfquery>
I'm having some trouble figuring out how this might be implemented... If
it's possible or worth it....
-----Original Message-----
From: Jochem van Dieten [mailto:[EMAIL PROTECTED]
Sent: Friday, September 08, 2006 9:39 AM
To: CF-Talk
Subject: Re: Locking Theory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting,
up-to-date ColdFusion information by your peers, delivered to your door four
times a year.
http://www.fusionauthority.com/quarterly
Archive:
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:252583
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4