PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Autres forums > Forum Programmation & Conception > mysql.general > write lock and sql_cache
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
write lock and sql_cache

Réponse
 
LinkBack Outils de la discussion
Vieux 12/03/2008, 21h15   #1
MAS!
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut write lock and sql_cache

does the "lock table" on MySQL (I'm using 5.0.22 or 5.0.45) works
even for a cached result?

this is my scenario, (I'm using MyIsam tables)

thread 1:
LOCK TABLE foo WRITE;

thread 2:
SELECT * FROM foo ;
(locked)

thread 1:
UNLOCK TABLES;

thread 2:
result of SELECT * ..

and that's is, IMHO, correct; btw, if the result of the select is in
the cache, it seems that I'm unable to 'lock' again the table:

thread 1:
LOCK TABLE foo WRITE;

thread 2:
SELECT * FROM foo ;
I have the result of the select; that was not 'locked'

the only way I found to avoid that is use the SQL_NO_CACHE (then
SELECT SQL_NO_CACHE FROM foo)

is that correct?! there is a way to avoid to specify "SQL_NO_CACHE" ?
or there is something wrong ?!
thank you in avance.
bye bye
marco


  Réponse avec citation
Vieux 12/03/2008, 21h22   #2
Daniel Brown
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: write lock and sql_cache

On Wed, Mar 12, 2008 at 3:15 PM, MAS! <urkapd@libero.it> wrote:
> does the "lock table" on MySQL (I'm using 5.0.22 or 5.0.45) works
> even for a cached result?


Hold your horses, dude. That's the third time you sent that
email. Someone will give you an answer if you're patient.

If you can't wait (or don't feel like it), check out the forum at
http://www.mysqlfreaks.com/.

Best of luck, Marco!

--
</Dan>

Daniel P. Brown
Senior Unix Geek
<? while(1) { $me = $mind--; sleep(86400); } ?>
  Réponse avec citation
Vieux 13/03/2008, 04h01   #3
Baron Schwartz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: write lock and sql_cache

On Wed, Mar 12, 2008 at 3:22 PM, Daniel Brown <parasane@gmail.com> wrote:
> On Wed, Mar 12, 2008 at 3:15 PM, MAS! <urkapd@libero.it> wrote:
> > does the "lock table" on MySQL (I'm using 5.0.22 or 5.0.45) works
> > even for a cached result?

>
> Hold your horses, dude. That's the third time you sent that
> email. Someone will give you an answer if you're patient.


I agree. Don't duplicate posts or post to multiple lists. Jump on
the IRC channel if you need right away :-)

The query_cache_wlock_invalidate server variable controls the behavior
you are seeing. You can configure it as desired.

Baron
  Réponse avec citation
Vieux 13/03/2008, 06h33   #4
Werner Puschitz
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: write lock and sql_cache

MAS! wrote:
> does the "lock table" on MySQL (I'm using 5.0.22 or 5.0.45) works even
> for a cached result?
>
> this is my scenario, (I'm using MyIsam tables)
>
> thread 1:
> LOCK TABLE foo WRITE;
>
> thread 2:
> SELECT * FROM foo ;
> (locked)
>
> thread 1:
> UNLOCK TABLES;
>
> thread 2:
> result of SELECT * ..
>
> and that's is, IMHO, correct; btw, if the result of the select is in the
> cache, it seems that I'm unable to 'lock' again the table:
>
> thread 1:
> LOCK TABLE foo WRITE;
>
> thread 2:
> SELECT * FROM foo ;
> I have the result of the select; that was not 'locked'
>
> the only way I found to avoid that is use the SQL_NO_CACHE (then SELECT
> SQL_NO_CACHE FROM foo)
>
> is that correct?! there is a way to avoid to specify "SQL_NO_CACHE" ?
> or there is something wrong ?!


Try setting query_cache_wlock_invalidate to ON.

Werner

  Réponse avec citation
Vieux 13/03/2008, 21h37   #5
MAS!
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: write lock and sql_cache

> I agree. Don't duplicate posts or post to multiple lists. Jump on
> the IRC channel if you need right away :-)


sorry again, I was not in hurry, but I had a fault on my mailer,
since I was trying to send the post from office and from the wrong
account..

> The query_cache_wlock_invalidate server variable controls the behavior
> you are seeing. You can configure it as desired.


thank you so much to all..

by
MAS!

  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 05h12.


Édité par : vBulletin® version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,09609 seconds with 13 queries