Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[phoenix-dev] Database read-only flag

Team,

This e-mail is for those who have pages that *write* to the database, by using either INSERT, UPDATE, DROP, DELETE or any other write operation.

Occasionally the webmaster needs to put the databases in read-only mode for maintenance. If an app tries to write to the database while in read-only mode, the query will simply be queued then silently discarded. Most of the software we run has a knob that allows the application to deal with this gracefully; for those sites that do not have such a knob, we typically shut down the entire site.

We don't want to have to shut down www.eclipse.org for DB maintenance.

Therefore, I have added a function to the $App class to determine whether the database is in read-only mode. Please update your code to detect this condition and handle it gracefully.


For instance:
if($App->getDBReadOnly()) {
            # Can not write to DB
}
else {
      $SQL = "UPDATE....";
}

Or, at the page level:

if($App->getDBReadOnly()) {
echo 'This page is unavailable for maintenance. Please try later";
            exit;
}

If you have any questions, please let me know.

Denis


--
Denis Roy
Manager, IT Infrastructure
Eclipse Foundation, Inc.  --  http://www.eclipse.org/
Office: 613.224.9461 x224 (Eastern time)
Cell: 819.210.6481
denis.roy@xxxxxxxxxxx



Back to the top