[TYPO3-dev] Is a lock tables possible with TYPO3

Ries van Twisk typo3 at rvt.dds.nl
Thu Jun 1 22:22:40 CEST 2006


Søren,

I don't know MYSQL well enought but it seem like you are locking for 
READ, thus you cannot write.
But aren't you looking for transactions insead of table looking? (I 
don't belive it's supported by DBAL but transactions are both teh same 
in mysql and postgresql).

MYSQL Quote : If a thread obtains a |READ| lock on a table, that thread 
(and all other threads) can only read from the table. If a thread 
obtains a |WRITE| lock on a table, only the thread holding the lock can 
write to the table. Other threads are blocked from reading or writing 
the table until the lock has been released.
Remember that there is no such a thing as LOCK TABLE(S) in SQL 92.


Cheers,
Ries


>Hi there,
>
>I am trying to lock a table in one of my extensions to write the correct 
>data. I'm trying to use the typo3 DB functions but this doesn't seem to 
>work. The table will be locked but I cannot access it then...
>
>$GLOBALS['TYPO3_DB']->sql_query('LOCK TABLES tablex READ');	
>
>//get data from table		
>$Query = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
>	'rank',
>	'tablex'
>);		
>
>//...
>//...process data from table
>//...
>
>//write result back to table
>$GLOBALS['TYPO3_DB']->exec_INSERTquery(
>	'tablex',
>	array(
>		'rank' => $result,
>	)
>);
>			
>$GLOBALS['TYPO3_DB']->sql_query('UNLOCK TABLES');	
>
>
>Is it possible to lock and unlock tables with TYPO3 and still work with 
>them? If yes how should I do it?
>
>Thanks,
>Søren
>_______________________________________________
>TYPO3-dev mailing list
>TYPO3-dev at lists.netfielders.de
>http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
>  
>


-- 
Ries van Twisk
Freelance Typo3 Developer
=== Private:
email: ries at vantwisk.nl
web:   http://www.rvantwisk.nl/freelance-typo3.html
skype: callto://r.vantwisk
=== Work:
email: ries at livetravelguides.com
web:   http://www.livetravelguides.com





More information about the TYPO3-dev mailing list