blocked table while running select

A place for users and developers of the Xataface to discuss and receive support.

blocked table while running select

Postby Taralea » Fri Jun 01, 2012 6:05 am

Hello everybody,

i want to use "LOCK IN SHARE MODE" for each select query which is generated by Xataface itself.
For example: I have a table with a fields.ini and nothing else, so i don't care about the query.
Is there a way to tell Xataface to put "LOCK IN SHARE MODE" after each query or should i write the tablequery by myself? When i write it by myself, what happens with the query if i use filter or limit?
It's a little confusing, hope you could help me.

thanks,
Taralea
Taralea
 
Posts: 3
Joined: Fri Jun 01, 2012 5:46 am

Re: blocked table while running select

Postby shannah » Fri Jun 01, 2012 10:28 am

Interesting request. Why do you want to use lock in share mode? What are you trying to achieve?
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: blocked table while running select

Postby Taralea » Mon Jun 04, 2012 5:23 am

I use views in a database for Xataface and want to prevent a blocking of the whole database while running a large select. It's necessary for the user, to be able to insert or update data at the same time the select is running. Xataface is used only to show the data not to change them. I use lock in share mode in all functions and selects in the database but i have to call the views with it too.
Taralea
 
Posts: 3
Joined: Fri Jun 01, 2012 5:46 am

Re: blocked table while running select

Postby shannah » Mon Jun 04, 2012 11:28 am

I think that LOCK IN SHARE MODE will have the opposite effect of what you want. If you perform a SELECT with LOCK IN SHARE MODE, it will prevent any other sessions from modifying any of the rows that you found in the select until you either commit your transaction, or your session ends (i.e. the end of the HTTP request).
http://dev.mysql.com/doc/refman/5.0/en/ ... reads.html

The default behavior (without using LOCK IN SHARE MODE) sounds like what you want. It will perform the select without blocking any other sessions from performing their work.

-Steve
shannah
 
Posts: 4457
Joined: Wed Dec 31, 1969 5:00 pm

Re: blocked table while running select

Postby Taralea » Mon Jun 18, 2012 4:58 am

Sorry for the delay,
you are right. I have read a wrong article about that. Thanks so much for your help.

Taralea
Taralea
 
Posts: 3
Joined: Fri Jun 01, 2012 5:46 am


Return to Xataface Users

Who is online

Users browsing this forum: No registered users and 1 guest

cron
Powered by Dataface
© 2005-2007 Steve Hannah All rights reserved