You can try:
db.executesql('LOCK TABLE tablename READ;')
http://aarklondatabasetrivia.blogspot.com/2009/04/how-to-lock-and-unlock-tables-in-mysql.html
On Thursday, 11 October 2012 01:44:14 UTC-5, vince wrote:
>
> can i lock a table as readonly during the transaction? the case is i need
> to insert a record to table B which is base on the query result of table A,
> i would like to lock table A as readonly until i finish the insert.
>
> i am using mysql at the moment. i know web2py may not have this feature,
> what is the best way to use mysql's 'lock table' on web2py?
>
> thanks in advance,
> vince
>
--