Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEsteban Dugueperoux2014-12-03 07:58:36 +0000
committerEsteban Dugueperoux2014-12-03 09:39:40 +0000
commit6ef8eb3c8a00a3410e2bcbce25d6cd1218f3fabf (patch)
treeee95e0c96fff1e62864cb35299766a2f534bc105
parent7d0171987a44a0ef5cbdcaeb11a5414d23fb3dd9 (diff)
downloadcdo-6ef8eb3c8a00a3410e2bcbce25d6cd1218f3fabf.tar.gz
cdo-6ef8eb3c8a00a3410e2bcbce25d6cd1218f3fabf.tar.xz
cdo-6ef8eb3c8a00a3410e2bcbce25d6cd1218f3fabf.zip
[453173] Reduce consumed memory by DBStore
Have ObjectTypeTable reset its field on deactivation. Have DBField store Exception only when DBIndex.DISABLE_NULLABLE_CHECK and DBIndex.FIX_NULLABLE_INDEX_COLUMNS are at false to limit comsumed memory of DBField. Change-Id: If1a0b11e0405bcefdf0d73ff42b21f97fe8c7ca7 Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=453173 Signed-off-by: Esteban Dugueperoux <esteban.dugueperoux@obeo.fr>
-rw-r--r--features/org.eclipse.emf.cdo.server.db-feature/feature.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/META-INF/MANIFEST.MF16
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java10
-rw-r--r--plugins/org.eclipse.net4j.db/META-INF/MANIFEST.MF2
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBField.java7
-rw-r--r--plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBAdapter.java3
8 files changed, 54 insertions, 12 deletions
diff --git a/features/org.eclipse.emf.cdo.server.db-feature/feature.xml b/features/org.eclipse.emf.cdo.server.db-feature/feature.xml
index b4e201fd4e..2d5111a959 100644
--- a/features/org.eclipse.emf.cdo.server.db-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo.server.db-feature/feature.xml
@@ -12,7 +12,7 @@
<feature
id="org.eclipse.emf.cdo.server.db"
label="%featureName"
- version="4.2.200.qualifier"
+ version="4.3.0.qualifier"
provider-name="%providerName"
license-feature="org.eclipse.emf.cdo.license"
license-feature-version="0.0.0">
diff --git a/plugins/org.eclipse.emf.cdo.server.db/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.server.db/META-INF/MANIFEST.MF
index 2ad317f67f..c3b08ebfc0 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.server.db/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.server.db;singleton:=true
-Bundle-Version: 4.2.200.qualifier
+Bundle-Version: 4.3.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -12,10 +12,10 @@ Bundle-ClassPath: .
Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)",
org.eclipse.net4j.db;bundle-version="[4.0.0,5.0.0)";visibility:=reexport,
org.eclipse.emf.cdo.server;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo.server.db;version="4.2.200",
- org.eclipse.emf.cdo.server.db.mapping;version="4.2.200",
- org.eclipse.emf.cdo.server.internal.db;version="4.2.200";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.tests.db",
- org.eclipse.emf.cdo.server.internal.db.bundle;version="4.2.200";x-internal:=true,
- org.eclipse.emf.cdo.server.internal.db.mapping;version="4.2.200";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.tests.db",
- org.eclipse.emf.cdo.server.internal.db.mapping.horizontal;version="4.2.200";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.tests.db",
- org.eclipse.emf.cdo.server.internal.db.messages;version="4.2.200";x-internal:=true
+Export-Package: org.eclipse.emf.cdo.server.db;version="4.3.0",
+ org.eclipse.emf.cdo.server.db.mapping;version="4.3.0",
+ org.eclipse.emf.cdo.server.internal.db;version="4.3.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.tests.db",
+ org.eclipse.emf.cdo.server.internal.db.bundle;version="4.3.0";x-internal:=true,
+ org.eclipse.emf.cdo.server.internal.db.mapping;version="4.3.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.tests.db",
+ org.eclipse.emf.cdo.server.internal.db.mapping.horizontal;version="4.3.0";x-friends:="org.eclipse.emf.cdo.tests,org.eclipse.emf.cdo.tests.db",
+ org.eclipse.emf.cdo.server.internal.db.messages;version="4.3.0";x-internal:=true
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java
index 6c9083be1b..0619769bb9 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/db/IDBStore.java
@@ -128,5 +128,10 @@ public interface IDBStore extends IStore, IDBConnectionProvider, CanHandleClient
* @since 4.2
*/
public static final String WRITER_POOL_CAPACITY = "writerPoolCapacity"; //$NON-NLS-1$
+
+ /**
+ * @since 4.3
+ */
+ public static final String FIELD_CONSTRUCTION_TRACKING = "fieldConstructionTracking"; //$NON-NLS-1$
}
}
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
index 14befb61a5..be552add80 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStoreAccessor.java
@@ -70,6 +70,7 @@ import org.eclipse.net4j.db.DBUtil;
import org.eclipse.net4j.db.IDBConnection;
import org.eclipse.net4j.db.IDBPreparedStatement;
import org.eclipse.net4j.db.IDBPreparedStatement.ReuseProbability;
+import org.eclipse.net4j.internal.db.ddl.DBField;
import org.eclipse.net4j.util.HexUtil;
import org.eclipse.net4j.util.ObjectUtil;
import org.eclipse.net4j.util.StringUtil;
@@ -808,6 +809,26 @@ public class DBStoreAccessor extends StoreAccessor implements IDBStoreAccessor,
return getStore().getMetaDataManager().readPackageUnits(getConnection());
}
+ @Override
+ protected void doWrite(InternalCommitContext context, OMMonitor monitor)
+ {
+ boolean oldValue = DBField.isTrackConstruction();
+ try
+ {
+ String prop = getStore().getProperties().get(IDBStore.Props.FIELD_CONSTRUCTION_TRACKING);
+ if (prop != null)
+ {
+ DBField.trackConstruction(Boolean.valueOf(prop));
+ }
+
+ super.doWrite(context, monitor);
+ }
+ finally
+ {
+ DBField.trackConstruction(oldValue);
+ }
+ }
+
public void writePackageUnits(InternalCDOPackageUnit[] packageUnits, OMMonitor monitor)
{
monitor.begin(2);
diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java
index ccaf107666..22eacc9ced 100644
--- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java
+++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/mapping/horizontal/ObjectTypeTable.java
@@ -239,4 +239,14 @@ public class ObjectTypeTable extends AbstractObjectTypeMapper implements IMappin
+ ") VALUES (?, ?, ?)";
sqlDelete = "DELETE FROM " + table + " WHERE " + ATTRIBUTES_ID + "=?";
}
+
+ @Override
+ protected void doDeactivate() throws Exception
+ {
+ sqlDelete = null;
+ sqlInsert = null;
+ sqlSelect = null;
+ table = null;
+ super.doDeactivate();
+ }
}
diff --git a/plugins/org.eclipse.net4j.db/META-INF/MANIFEST.MF b/plugins/org.eclipse.net4j.db/META-INF/MANIFEST.MF
index c9b9b8558e..bc5490edf3 100644
--- a/plugins/org.eclipse.net4j.db/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.net4j.db/META-INF/MANIFEST.MF
@@ -17,7 +17,7 @@ Export-Package: org.eclipse.net4j.db;version="4.4.0",
org.eclipse.net4j.db.dml;version="4.4.0",
org.eclipse.net4j.internal.db;version="4.4.0";x-internal:=true,
org.eclipse.net4j.internal.db.bundle;version="4.4.0";x-internal:=true,
- org.eclipse.net4j.internal.db.ddl;version="4.4.0";x-internal:=true,
+ org.eclipse.net4j.internal.db.ddl;version="4.4.0";x-friends:="org.eclipse.emf.cdo.server.db",
org.eclipse.net4j.internal.db.ddl.delta;version="4.4.0";x-internal:=true,
org.eclipse.net4j.internal.db.dml;version="4.4.0";x-internal:=true,
org.eclipse.net4j.spi.db;version="4.4.0",
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBField.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBField.java
index b28ad0a836..04e168229a 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBField.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/internal/db/ddl/DBField.java
@@ -48,7 +48,7 @@ public class DBField extends DBSchemaElement implements InternalDBField
@Override
protected Boolean initialValue()
{
- return true;
+ return false;
}
};
@@ -294,4 +294,9 @@ public class DBField extends DBSchemaElement implements InternalDBField
TRACK_CONSTRUCTION.remove();
}
}
+
+ public static boolean isTrackConstruction()
+ {
+ return TRACK_CONSTRUCTION.get();
+ }
}
diff --git a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBAdapter.java b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBAdapter.java
index 4011df2b89..a914c14822 100644
--- a/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBAdapter.java
+++ b/plugins/org.eclipse.net4j.db/src/org/eclipse/net4j/spi/db/DBAdapter.java
@@ -155,6 +155,7 @@ public abstract class DBAdapter implements IDBAdapter
*/
public void readSchema(Connection connection, IDBSchema schema)
{
+ boolean isTrackConstruction = DBField.isTrackConstruction();
try
{
DBField.trackConstruction(false);
@@ -183,7 +184,7 @@ public abstract class DBAdapter implements IDBAdapter
}
finally
{
- DBField.trackConstruction(true);
+ DBField.trackConstruction(isTrackConstruction);
}
}

Back to the top