I am new to RAP (I'm looking at it to develop a Firefox/RDF based
application and am looking for a good way to keep my server datasources
in sync)- it looks neat so far :-) but I've come across a couple of
problems.
1. Running through the Test:Manipulate DbModel I figured out that I had
to call getNewModel if the model didn't exist. A note to this effect or
adding ti to the source code would be handy.
2. I encountered adodb errors in 2 places where the mysql commands were
out of sync (I'm using MySQL 4.1.14 and PHP 5.1.2). I upgraded the
adodb drivers to the latest versions but that was no help. To fix the
problem I had to modify two functions in DbStore and DbModel by adding a
$res->close() statement.
My modified code is :
function modelExists($modelURI) {
$res =& $this->dbConn->execute("SELECT COUNT(*) FROM models
WHERE modelURI = '" .$modelURI ."'");
if (!$res)
echo $this->dbConn->errorMsg();
else {
$res->close();
if (!$res->fields[0])
return FALSE;
return TRUE;
}
}
function contains(&$statement) {
$sql = 'SELECT modelID FROM statements
WHERE modelID = ' .$this->modelID;
$sql .= $this->_createDynSqlPart_SPO($statement->subj,
$statement->pred, $statement->obj);
$res =& $this->dbConn->getOne($sql);
if (!$res)
return FALSE;
$res->close();
return TRUE;
}
I don't have any other Databases to test this on. Is this a specific
bug to the mysqli driver?
Geraint
|