diff options
author | Eike Stepper | 2016-03-02 08:10:13 +0000 |
---|---|---|
committer | Eike Stepper | 2016-03-02 08:10:13 +0000 |
commit | 7aefe57973e4d5aec8a5cbc5011f77b48f787f13 (patch) | |
tree | 0b6881efe426b5fc3856b4e58ce2a0a3474f26d0 /plugins | |
parent | a3c5d78e54e9fb1045430999fdfd4b336987e283 (diff) | |
download | cdo-7aefe57973e4d5aec8a5cbc5011f77b48f787f13.tar.gz cdo-7aefe57973e4d5aec8a5cbc5011f77b48f787f13.tar.xz cdo-7aefe57973e4d5aec8a5cbc5011f77b48f787f13.zip |
[488820] Add a dropAllDataOnActivate property to DBStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=488820
Diffstat (limited to 'plugins')
3 files changed, 23 insertions, 0 deletions
diff --git a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/operators/Doc01_ConfiguringRepositories.java b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/operators/Doc01_ConfiguringRepositories.java index 910cdd4975..2b45944732 100644 --- a/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/operators/Doc01_ConfiguringRepositories.java +++ b/plugins/org.eclipse.emf.cdo.doc/src/org/eclipse/emf/cdo/doc/operators/Doc01_ConfiguringRepositories.java @@ -288,6 +288,18 @@ public class Doc01_ConfiguringRepositories public class Property_writerPoolCapacity { } + + /** + * Property dropAllDataOnActivate + * <p> + * If set to <code>true</code> and the store is a DBStore, drops all database tables of the configured + * {@link Element_dataSource schema} at the beginning of the store activation. + * <p> + * The default value is <code>false</code>. + */ + public class Property_dropAllDataOnActivate + { + } } /** 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 5cb3bb67dc..ce5824880a 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 @@ -133,5 +133,10 @@ public interface IDBStore extends IStore, IDBConnectionProvider, CanHandleClient * @since 4.3 */ public static final String FIELD_CONSTRUCTION_TRACKING = "fieldConstructionTracking"; //$NON-NLS-1$ + + /** + * @since 4.4 + */ + public static final String DROP_ALL_DATA_ON_ACTIVATE = "dropAllDataOnActivate"; //$NON-NLS-1$ } } diff --git a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java index 62aad4594e..62322f5eb9 100644 --- a/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java +++ b/plugins/org.eclipse.emf.cdo.server.db/src/org/eclipse/emf/cdo/server/internal/db/DBStore.java @@ -598,6 +598,12 @@ public class DBStore extends Store implements IDBStore, IMappingConstants, CDOAl configureAccessorPool(readerPool, IDBStore.Props.READER_POOL_CAPACITY); configureAccessorPool(writerPool, IDBStore.Props.WRITER_POOL_CAPACITY); + + String prop = properties.get(IDBStore.Props.DROP_ALL_DATA_ON_ACTIVATE); + if (prop != null) + { + setDropAllDataOnActivate(Boolean.parseBoolean(prop)); + } } Connection connection = getConnection(); |