newDB 함수 사용시 static 변수로 DB Object를 보관하도록 설정. 모든 update 명령은 global lock 하에서 통제되므로 이 방식을 사용할 수 있음.
This commit is contained in:
@@ -17,7 +17,13 @@ function newRootDB(){
|
||||
$port = _port_;
|
||||
$encoding = 'utf8';
|
||||
|
||||
return new MeekroDB($host,$user,$password,$dbName,$port,$encoding);
|
||||
static $uDB = NULL;
|
||||
|
||||
if($uDB === NULL){
|
||||
$uDB = new MeekroDB($host,$user,$password,$dbName,$port,$encoding);
|
||||
}
|
||||
|
||||
return $uDB;
|
||||
}
|
||||
|
||||
function newMailObj(){
|
||||
|
||||
Reference in New Issue
Block a user