vgritsenko 2004/01/28 06:12:52
Modified: java/src/org/apache/xindice/core Database.java
Log:
Optimize database config flush, use isDirty()
Revision Changes Path
1.36 +12 -10
xml-xindice/java/src/org/apache/xindice/core/Database.java
Index: Database.java
===================================================================
RCS file:
/home/cvs/xml-xindice/java/src/org/apache/xindice/core/Database.java,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -r1.35 -r1.36
--- Database.java 9 Jan 2004 03:42:56 -0000 1.35
+++ Database.java 28 Jan 2004 14:12:51 -0000 1.36
@@ -195,15 +195,17 @@
* properly flushed to disk after a modification.
*/
public void flushConfig() {
- try {
- Document d = getConfig().getElement().getOwnerDocument();
-
systemCollection.getCollection(SystemCollection.CONFIGS).setDocument(COLKEY, d);
- } catch (Exception e) {
- log.error("Error Writing Configuration '" + getName() + "', for
database " + getName(), e);
- }
+ if (getConfig().isDirty()) {
+ try {
+ Document d = getConfig().getElement().getOwnerDocument();
+
systemCollection.getCollection(SystemCollection.CONFIGS).setDocument(COLKEY, d);
+ } catch (Exception e) {
+ log.error("Error Writing Configuration '" + getName() + "',
for database " + getName(), e);
+ }
- // observer
- DBObserver.getInstance().flushDatabaseConfig(this, getConfig());
+ // Observer
+ DBObserver.getInstance().flushDatabaseConfig(this, getConfig());
+ }
}
/**