MySQL Forums
Forum List  »  Federated Storage Engine

locking federated table not possible?
Posted by: sebastian mork
Date: March 06, 2006 12:15PM

Hi,
is it not possible to lock federated tables (creating a lock on the remote machine to lock the table on the machine containing the data?)

I've a situation where I have some different databases on different servers but they share a small amount of tables that are physically stored on only one machine.
the other (remote) servers use these table as federated tables.

on the server where the data is stored physically in a myIsam-table I can lock the table, insert some data and unlock it.
I've made some tests where I create a write lock, then call 10000 queries to insert some data (when starting these queries I created a new request that tries to insert data) then the first request unlocks the table and the second request runs when the unlock is done. great.
but when I try to run a lock on a federated table it has no effect, I try to lock the table, insert 10000 rows and unlock the table again. but when I'm running a second request while the 10000 rows are inserted the second request doesnt wait for the table to be unlocked, the data is inserted while the first request is made.

here is my request thats starting first: (some pseudo-style code)
---
lock tables tbl_lager write;
do from 1 to 10000
INSERT INTO `tbl_lager` (`fld_pid`) VALUES ('1');
end do
unlock tables;
unlocked at #now()#

and heres the second that starts when the first is running:
---
lock tables tbl_lager write;
INSERT INTO `tbl_lager` (`fld_pid`) VALUES ('1');
unlock tables;
unlocked at #now()#


doing this local ob the server where the data is stored physically it works fine.
but on the federated table it doesn't work.

Any comments would be great. thx.

Options: ReplyQuote


Subject
Views
Written By
Posted
locking federated table not possible?
4045
March 06, 2006 12:15PM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.