[TYPO3-dev] Is a lock tables possible with TYPO3
Andreas Förthner
Andreas.Foerthner at netlogix.de
Fri Jun 2 02:07:14 CEST 2006
Søren Schaffstein schrieb:
> 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
Hi,
sorry I don't have much time to get deeper into this topic, but one idea
from me: Your table gets locked, while this locking you only can access
it with the connection that has locked the table. So if you can't access
it, I would say, that you try to access it with a different connection.
You will have to look for db functions that work in the same connection,
I think this could be very difficult with TYPO3 especially with DBAL.
Sorry for less information, but perhaps you now have direction... Would
be intersting if this was the reason...
Greets
Andreas
More information about the TYPO3-dev
mailing list