Hi,

here' mysql version
Code:
mysql> show variables where variable_name like '%version%'//
+-------------------------+------------------------------+
| Variable_name           | Value                        |
+-------------------------+------------------------------+
| innodb_version          | 1.1.8                        |
| protocol_version        | 10                           |
| slave_type_conversions  |                              |
| version                 | 5.5.27                       |
| version_comment         | MySQL Community Server (GPL) |
| version_compile_machine | x86                          |
| version_compile_os      | Win32                        |
+-------------------------+------------------------------+
7 rows in set (0.00 sec)
here' my code.
Code:
delimiter //

SELECT CONNECTION_ID()//

LOCK TABLES source.jos_daikin_control_card_fcu_model WRITE//

CREATE PROCEDURE transfer_to_control_card_fcu_model()
BEGIN
DECLARE v_source_daikin_max_fcu_id int;
DECLARE v_target_daikin_max_fcu_id int;
	SELECT max(fcu_id) INTO v_source_daikin_max_fcu_id from source.control_card_fcu_model;
	SELECT v_source_daikin_max_fcu_id;
	
	SELECT max(fcu_id) INTO v_target_daikin_max_fcu_id from target.control_card_fcu_model;
	SELECT v_target_daikin_max_fcu_id;

END;
//

ERROR 1192 (HY000): Can't execute the given command because you have active lock
ed tables or an active transaction
Is there a way to prevent other session from accessing the tables called in the procedure?

thanks a lot!