Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [CDO] Server configuration for audit mode
[CDO] Server configuration for audit mode [message #1702728] Fri, 24 July 2015 11:11 Go to next message
Robert Schulk is currently offline Robert SchulkFriend
Messages: 51
Registered: July 2015
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 Go to previous message
Eike Stepper is currently offline Eike StepperFriend
Messages: 6447
Registered: July 2009
Senior Member
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);
>


Previous Topic:Copy a CDOResource contents to a text file
Next Topic:Are there any SoaML EMF implementations?
Goto Forum:
  


Current Time: Thu Oct 24 05:00:06 GMT 2019

Powered by FUDForum. Page generated in 1.27132 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top