[CDO] Server configuration for audit mode [message #1702728] |
Fri, 24 July 2015 11:11 |
Robert Schulk Messages: 144 Registered: July 2015 |
Senior Member |
|
|
Hi,
we are using CDO with an H2 database backend. Since our model is changing
frequently and we do not necessarily need old revisions, I would like to turn off
the audit mode to keep the database from growing very large.
My first attempt was to set the server property IRepository.Props.SUPPORTING_AUDITS to false, but the database kept growing.
Changing the mapping strategy from HorizontalAuditMappingStrategy() ==>
HorizontalNonAuditMappingStrategy() finally did the trick.
Does anyone know what the supporting audits property is doing?
Thanks!
Here is part of the code which I use to create the server:
// Get database
File repoLocation = new File(ResourcesPlugin.getWorkspace().getRoot().getLocationURI().getPath() + File.separator + "cdodb");
JdbcDataSource dataSource = getJdbcDataSource("jdbc:h2:" + repoLocation + File.separator + REPOSITORY_NAME);
// Setup Store
IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(false);
IDBAdapter dbAdapter = new H2Adapter();
IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
IStore store = CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
// Setup Repository
Map<String, String> props = new HashMap<String, String>();
props.put(IRepository.Props.OVERRIDE_UUID, REPOSITORY_NAME);
props.put(IRepository.Props.SUPPORTING_AUDITS, "false");
props.put(IRepository.Props.SUPPORTING_BRANCHES, "false");
IRepository repo = CDOServerUtil.createRepository(REPOSITORY_NAME, store, props);
|
|
|
Re: [CDO] Server configuration for audit mode [message #1702761 is a reply to message #1702728] |
Fri, 24 July 2015 13:26 |
|
Am 24.07.2015 um 14:36 schrieb Robert Schulk:
> Hi,
>
> we are using CDO with an H2 database backend. Since our model is changing
> frequently and we do not necessarily need old revisions, I would like to turn off
> the audit mode to keep the database from growing very large.
>
> My first attempt was to set the server property IRepository.Props.SUPPORTING_AUDITS to false, but the database kept
> growing.
> Changing the mapping strategy from HorizontalAuditMappingStrategy() ==>
> HorizontalNonAuditMappingStrategy() finally did the trick.
IRepository.Props.SUPPORTING_AUDITS is the authoritative property to control the auditing mode. Formerly the mapping
strategy of the DBStore had to be chosen to match that property. These days there's horizontal mapping strategy that
automatically delegates to a specific mapping strategy as defined by that repo property:
CDODBUtil.createHorizontalMappingStrategy().
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
>
> Does anyone know what the supporting audits property is doing?
>
> Thanks!
>
>
> Here is part of the code which I use to create the server:
>
> // Get database
> File repoLocation = new File(ResourcesPlugin.getWorkspace().getRoot().getLocationURI().getPath() +
> File.separator + "cdodb");
> JdbcDataSource dataSource = getJdbcDataSource("jdbc:h2:" + repoLocation + File.separator + REPOSITORY_NAME);
>
> // Setup Store
> IMappingStrategy mappingStrategy = CDODBUtil.createHorizontalMappingStrategy(false);
> IDBAdapter dbAdapter = new H2Adapter();
> IDBConnectionProvider dbConnectionProvider = DBUtil.createConnectionProvider(dataSource);
> IStore store = CDODBUtil.createStore(mappingStrategy, dbAdapter, dbConnectionProvider);
> // Setup Repository
> Map<String, String> props = new HashMap<String, String>();
> props.put(IRepository.Props.OVERRIDE_UUID, REPOSITORY_NAME);
> props.put(IRepository.Props.SUPPORTING_AUDITS, "false");
> props.put(IRepository.Props.SUPPORTING_BRANCHES, "false");
> IRepository repo = CDOServerUtil.createRepository(REPOSITORY_NAME, store, props);
>
Cheers
/Eike
----
http://www.esc-net.de
http://thegordian.blogspot.com
http://twitter.com/eikestepper
|
|
|
Powered by
FUDForum. Page generated in 0.02956 seconds