-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

hi,

another question on innodb.

right now I'm using table locks. They work, but of course they are slow as
hell. low-level locking would be great. but. my application could
cause an innodb deadlock just about anywhere.

(2 users attacking each other: user A is locked for update; user B is
locked for update; user A attacked user B, so I need to update that data,
lock that -> wait; user B attacked user A, so I need to update that data,
lock that -> deadlock) This is a rare situation, but CAN come up with just
about anything (steaing, buying each other's stuff, casting magic etc.).

Is there an *EASY* way to detect deadlocks, other than having to check for
mysql_error (in php) after *EVERY* select and update?

Maybe I'm dreaming here ;), but what I imagined was a way to see if there
was a deadlock (or timeout) error during the transaction, not just the
last query. I would do this just before "commit", and if there were
errors, I would just roll back.

The way I see it now, I have to add a line to check for deadocks after
every select and update, set a variable according to the result (every
time), and check that variable before commit.

This -- other than gives me a bit of work ;) -- will slow down the php
script, since there is now a new if statement after every query. Maybe I
will end up having better speed with table locks.

So I would really like to avoid this, if there's an easier way. Is there?
:)

Thanks a lot,

Attila

...........................................................................
The devil can cite Scripture for his purpose. -William Shakespeare, poet
and dramatist (1564-1616)

- ---
Public key: http://civ.hu/attila.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD4DBQE7+illDeyfLhmXxQwRAtvlAJYxgONO80r4RnamgJw67e9x9aUsAJ9AhMWk
nUe6RcFZ6gw/lm3I7E2Abw==
=tp+L
-----END PGP SIGNATURE-----


---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to