Index: branches/rel/data/class/SC_Query.php
===================================================================
--- branches/rel/data/class/SC_Query.php	(revision 12157)
+++ branches/rel/data/class/SC_Query.php	(revision 14921)
@@ -419,21 +419,21 @@
 	}
 	
-	// auto_increment¤ò¼èÆÀ¤¹¤ë
-	function get_auto_increment($table_name){
-		// ¥í¥Ã¥¯¤¹¤ë
-		$this->BEGIN();
-		
-		// ¼¡¤ÎIncrement¤ò¼èÆÀ
-		$arrRet = $this->getAll("SHOW TABLE STATUS LIKE ?", array($table_name));
-		$auto_inc_no = $arrRet[0]["Auto_increment"];
-		
-		// ÃÍ¤ò¥«¥¦¥ó¥È¥¢¥Ã¥×¤·¤Æ¤ª¤¯
-		$this->conn->query("ALTER TABLE $table_name AUTO_INCREMENT=?" , $auto_inc_no + 1);
-		
-		// ²ò½ü¤¹¤ë
-		$this->COMMIT();
-		
-		return $auto_inc_no;
-	}
+    // auto_increment¤ò¼èÆÀ¤¹¤ë
+    function get_auto_increment($table_name){
+        // ¥í¥Ã¥¯¤¹¤ë
+        $this->query("LOCK TABLES $table_name WRITE");
+        
+        // ¼¡¤ÎIncrement¤ò¼èÆÀ
+        $arrRet = $this->getAll("SHOW TABLE STATUS LIKE ?", array($table_name));
+        $auto_inc_no = $arrRet[0]["Auto_increment"];
+        
+        // ÃÍ¤ò¥«¥¦¥ó¥È¥¢¥Ã¥×¤·¤Æ¤ª¤¯
+        $this->conn->query("ALTER TABLE $table_name AUTO_INCREMENT=?" , $auto_inc_no + 1);
+        
+        // ²ò½ü¤¹¤ë
+        $this->query('UNLOCK TABLES');
+        
+        return $auto_inc_no;
+    }
 }
 
