|
@@ -44,7 +44,7 @@ abstract class CoRefPool
|
|
}
|
|
}
|
|
|
|
|
|
$count = count($this->mUsingClients);
|
|
$count = count($this->mUsingClients);
|
|
- Log::record("get mUsingCount={$count}",Log::DEBUG);
|
|
|
|
|
|
+ Log::record("mysqli get cid={$cid} mUsingCount={$count}",Log::DEBUG);
|
|
|
|
|
|
return $client;
|
|
return $client;
|
|
}
|
|
}
|
|
@@ -54,8 +54,9 @@ abstract class CoRefPool
|
|
if(array_key_exists($cid,$this->mUsingClients)) {
|
|
if(array_key_exists($cid,$this->mUsingClients)) {
|
|
return $this->mUsingClients[$cid]['client'];
|
|
return $this->mUsingClients[$cid]['client'];
|
|
} else {
|
|
} else {
|
|
- Log::record(__METHOD__ . " cannot find mysqli cid={$cid} client",Log::DEBUG);
|
|
|
|
- throw new Exception("cannot find mysqli cid={$cid} client");
|
|
|
|
|
|
+ $msg = __METHOD__ . " mysqli cannot find mysqli cid={$cid} client";
|
|
|
|
+ Log::record($msg,Log::DEBUG);
|
|
|
|
+ throw new Exception($msg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -64,8 +65,9 @@ abstract class CoRefPool
|
|
if(array_key_exists($cid,$this->mUsingClients)) {
|
|
if(array_key_exists($cid,$this->mUsingClients)) {
|
|
return $this->mUsingClients[$cid]['client'] = $client;
|
|
return $this->mUsingClients[$cid]['client'] = $client;
|
|
} else {
|
|
} else {
|
|
- Log::record(__METHOD__ . " cannot find mysqli cid={$cid} client",Log::DEBUG);
|
|
|
|
- throw new Exception("cannot find mysqli cid={$cid} client");
|
|
|
|
|
|
+ $msg = __METHOD__ . " mysqli cannot find mysqli cid={$cid} client";
|
|
|
|
+ Log::record($msg,Log::DEBUG);
|
|
|
|
+ throw new Exception($msg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -74,8 +76,20 @@ abstract class CoRefPool
|
|
if(array_key_exists($cid,$this->mUsingClients)) {
|
|
if(array_key_exists($cid,$this->mUsingClients)) {
|
|
return $this->mUsingClients[$cid]['ifTransacting'];
|
|
return $this->mUsingClients[$cid]['ifTransacting'];
|
|
} else {
|
|
} else {
|
|
- Log::record(__METHOD__ . " cannot find mysqli cid={$cid} client",Log::DEBUG);
|
|
|
|
- throw new Exception("cannot find mysqli cid={$cid} client");
|
|
|
|
|
|
+ $msg = __METHOD__ . " mysqli cannot find mysqli cid={$cid} client";
|
|
|
|
+ Log::record($msg,Log::DEBUG);
|
|
|
|
+ throw new Exception($msg);
|
|
|
|
+ }
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function begin($cid)
|
|
|
|
+ {
|
|
|
|
+ if(array_key_exists($cid,$this->mUsingClients)) {
|
|
|
|
+ return $this->mUsingClients[$cid]['ifTransacting'] = true;
|
|
|
|
+ } else {
|
|
|
|
+ $msg = __METHOD__ . " mysqli cannot find mysqli cid={$cid} client";
|
|
|
|
+ Log::record($msg,Log::DEBUG);
|
|
|
|
+ throw new Exception($msg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -84,8 +98,9 @@ abstract class CoRefPool
|
|
if(array_key_exists($cid,$this->mUsingClients)) {
|
|
if(array_key_exists($cid,$this->mUsingClients)) {
|
|
return $this->mUsingClients[$cid]['ifTransacting'] = false;
|
|
return $this->mUsingClients[$cid]['ifTransacting'] = false;
|
|
} else {
|
|
} else {
|
|
- Log::record(__METHOD__ . " cannot find mysqli cid={$cid} client",Log::DEBUG);
|
|
|
|
- throw new Exception("cannot find mysqli cid={$cid} client");
|
|
|
|
|
|
+ $msg = __METHOD__ . " mysqli cannot find mysqli cid={$cid} client";
|
|
|
|
+ Log::record($msg,Log::DEBUG);
|
|
|
|
+ throw new Exception($msg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -94,8 +109,9 @@ abstract class CoRefPool
|
|
if(array_key_exists($cid,$this->mUsingClients)) {
|
|
if(array_key_exists($cid,$this->mUsingClients)) {
|
|
return $this->mUsingClients[$cid]['ifTransacting'] = false;
|
|
return $this->mUsingClients[$cid]['ifTransacting'] = false;
|
|
} else {
|
|
} else {
|
|
- Log::record(__METHOD__ . " cannot find mysqli cid={$cid} client",Log::DEBUG);
|
|
|
|
- throw new Exception("cannot find mysqli cid={$cid} client");
|
|
|
|
|
|
+ $msg = __METHOD__ . " mysqli cannot find mysqli cid={$cid} client";
|
|
|
|
+ Log::record($msg,Log::DEBUG);
|
|
|
|
+ throw new Exception($msg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -118,15 +134,16 @@ abstract class CoRefPool
|
|
Co::resume($suspend_cid);
|
|
Co::resume($suspend_cid);
|
|
}
|
|
}
|
|
|
|
|
|
- Log::record("CoRefPool put cid={$cid} suspend_cid={$suspend_cid} refcount={$refcount}",Log::DEBUG);
|
|
|
|
|
|
+ Log::record("mysqli CoRefPool put cid={$cid} suspend_cid={$suspend_cid} refcount={$refcount}",Log::DEBUG);
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- Log::record("CoRefPool put cid={$cid} refcount={$refcount}",Log::DEBUG);
|
|
|
|
|
|
+ Log::record("mysqli CoRefPool put cid={$cid} refcount={$refcount}",Log::DEBUG);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
else {
|
|
- Log::record(__METHOD__ . " cannot find mysqli cid={$cid} client",Log::DEBUG);
|
|
|
|
- throw new Exception("cannot find mysqli cid={$cid} client");
|
|
|
|
|
|
+ $msg = __METHOD__ . " mysqli cannot find mysqli cid={$cid} client";
|
|
|
|
+ Log::record($msg,Log::DEBUG);
|
|
|
|
+ throw new Exception($msg);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|