From: Andrey C. <sku...@us...> - 2006-06-16 15:22:31
|
Update of /cvsroot/eas-dev/eas/libcodb_query In directory sc8-pr-cvs5.sourceforge.net:/tmp/cvs-serv2049/libcodb_query Modified Files: command.prg Log Message: Fix another connection. Concurrent connections are still broken. Index: command.prg =================================================================== RCS file: /cvsroot/eas-dev/eas/libcodb_query/command.prg,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- command.prg 6 Jun 2006 13:29:30 -0000 1.2 +++ command.prg 16 Jun 2006 15:22:20 -0000 1.3 @@ -14,7 +14,6 @@ /** Class for database manipulation in console mode */ /* TODO: - - BUG: cannot create EXTENT normally (need close depositories before creation) - WHERE in SELECT statement: translate logical operation and quotes - export/import - use file content as command list @@ -165,13 +164,15 @@ for j in depl dep_content := dict:getValue( j ) name = cDB + dep_content:number - //?? "Open depository:", name, chr(10) dep := coDepository():new(j) if val(dict:error) <= 0 .and. dep:open() if dep_new == NIL dep_new := dep endif aadd(o:dep_list, { name, dep, curDB } ) + // Open all extents for safe thread + dep:extentOpenAll() + //?? "Opened depository:", name, chr(10) endif next o:dict_list[curDB][3] := dep_new @@ -189,19 +190,20 @@ /* Internal function for check database writable*/ static function __db_ready(dbPath) local oErr, f, fH, fErr:=0 - oErr := ErrorBlock({|e| break(e) }) +/* oErr := ErrorBlock({|e| break(e) }) begin sequence f := dbPath+PATH_DELIM+"counters.dbf" fH := fopen(f, 2) fErr := ferror() if fErr == 0 - fclose(fH) + fclose(fH) endif //?? f,fErr,chr(10) recover using oErr // ?? "Error open database "+dbPath+chr(10) return 1 end sequence +*/ return fErr /* Internal function for setting up db by its name */ @@ -234,7 +236,7 @@ /* Close connection to server */ function codb_close( self ) local i - + //?? "CLOSE DATABASE.&\n" if valtype(self) != 'O' .or. ( "CLASSNAME" $ self .and. self:className != "CODB_Client") return .F. endif @@ -1066,7 +1068,7 @@ /* 'CREATE' command */ static function ec_create( self, cmd, res, files ) - local oErr, dbh, d:=map(), dict, desc:='', i + local oErr, dbh, d:=map(), dict, desc:='', i, fErr:=0 if len(cmd) < 2 return "Unknown metaclass name for creation" @@ -1118,11 +1120,11 @@ // Open created database. dict := dbh:connect(d:id) - f := dict:path+PATH_DELIM+"counters.dbf" + /*f := dict:path+PATH_DELIM+"counters.dbf" fH := fopen(f, 0) fErr := ferror() fclose(fH) - + */ if fErr == 0 .and. .not. val(dict:error) > 0 .and. dict:open() // Append to databases list aadd(self:dict_list, { d:id, dict, NIL, d:path, d:name } ) @@ -1231,7 +1233,7 @@ endif //?? "CLASSES:", classes, chr(10) //?? "CLASSES_IDS:", classIds, chr(10) -//?? "DEP:", d:hDbData, chr(10) +//?? "DEP:", d, chr(10) // Second: fill result with 'where' condition check res:fields := attrs res:data := array(0) |