Re: parallel interpreter/db problem. transaction didn't fix.




"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
==================


.



Relevant Pages

  • Re: Working Transactions somehow started not to work
    ... Transaction and locking are not properties of recordsets but are properties ... Opening a served-based cursor will put a lock on ... SL> and are not associated necessarily with server-based cursors. ...
    (microsoft.public.access.adp.sqlserver)
  • Re: [RFC] fsblock
    ... the transaction code, without taking the page lock. ... The best long term option may be making the locking order ... and change writepage to punt to some other ...
    (Linux-Kernel)
  • Re: Help - Timing Logic
    ... Perhaps a stored proc may be faster to execute and return the values as opposed to building the transaction in the code. ... implement as above locking only the records you retrieve / update - need to watch out here for table locking ... ... you can lock individual rows ... ...
    (microsoft.public.dotnet.languages.vb)
  • Re: DAO recordset append single record locks entire table (linked table)
    ... if there was a locking error, ... I found that Access 2000 keeps doing page lock whenever a new record is ... added into the table inside a transaction. ... The default value for the registry entry is 0, ...
    (comp.databases.ms-access)
  • Re: parallel interpreter/db problem. transaction didnt fix.
    ... I couldn't get table locking to work - it just gave me invalid resource errors down the line on my queries. ... Do you suppose my transaction tryout didn't work because I had a SELECT directly after the COMMIT on the same connection? ...
    (comp.lang.php)