Re: parallel interpreter/db problem. transaction didn't fix.
- From: "Jim Michaels" <NOSPAMFORjmichae3@xxxxxxxxx>
- Date: Mon, 24 Apr 2006 18:10:31 -0700
"Jerry Stuckle" <jstucklex@xxxxxxxxxxxxx> wrote in message
news:p_Cdna5T2P24LtHZnZ2dnUVZ_v2dnZ2d@xxxxxxxxxxxxxx
Jim Michaels wrote:
well, adding the transaction didn't affect *anything*. so I'm thinking
wrong somewhere.
my guess was that instance B and instance A had both read the same value
at nearly the same time, UPDATEd with the same value as a result. a race
condition. I had *thought* a transaction would fix that, but obviously
there's something about transactions I don't understand. I couldn't get
table locking (counter READ) to work - it just gave me invalid resource
errors down the line on my queries. I've never used table locking in PHP
code before.
If I could get table locking going, maybe that would be the fix to my
problem.
Invalid resource errors should never occur. They mean you're getting an
error on your queries - and not checking for them.
Always check the results of MySQL queries! NEVER ASSUME THEY WORK!
And when you do check the result, what do you get?
checked the server error logs, figured out how to find & fix the errors and
actually get an error message. turned out the tables I had locked for READ
and later were trying to UPDATE (write) was the cause of the error, so I
needed a write lock. so I changed the LOCK TABLES to a write lock.
Then I got another error stating that the other tables down the line needed
to be locked too. (ugh) so I did. then things were fixed.
Sort of.
images were still duplicated. (not again!)
lock tables didn't do it for me. the only thing I can figure is that
*maybe* the write lock doesn't prevent reads to the table and I still have a
race condition.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.
- References:
- parallel interpreter/db problem. transaction didn't fix.
- From: Jim Michaels
- Re: parallel interpreter/db problem. transaction didn't fix.
- From: Gordon Burditt
- Re: parallel interpreter/db problem. transaction didn't fix.
- From: Jim Michaels
- Re: parallel interpreter/db problem. transaction didn't fix.
- From: Jerry Stuckle
- parallel interpreter/db problem. transaction didn't fix.
- Prev by Date: Re: parallel interpreter/db problem. transaction didn't fix.
- Next by Date: Re: parallel interpreter/db problem. transaction didn't fix.
- Previous by thread: Re: parallel interpreter/db problem. transaction didn't fix.
- Next by thread: Re: parallel interpreter/db problem. transaction didn't fix.
- Index(es):
Relevant Pages
|