cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hugi Thordarson <h...@godurkodi.is>
Subject Re: Changing the size of the snapshot cache in code
Date Tue, 21 Feb 2017 11:12:03 GMT
I created a custom DataDomainProvider, but it never gets used. The reason is that I’m using
serverRuntimeBuilder.dataSource( DataSource ) to set the DataSource. This causes ServerRuntimeBuilder
to set it’s dataSourceFactory, which then causes it to bind it’s own SyntheticNodeDataDomainProvider
when it invokes it’s builderModules() method at build time, overriding my own DataDomainProvider.



How best to get around this?

- hugi



> On 17. feb. 2017, at 06:59, Andrus Adamchik <andrus@objectstyle.org> wrote:
> 
> Only properties defined in org.apache.cayenne.configuration.Constants are recognized
by DI. DataRowStore.SNAPSHOT_CACHE_SIZE_PROPERTY is not one of them. 
> 
> We were actually going to bring the whole DataDomain configuration process into DI form
the Modeler (perhaps right after M5). For now your best bet is overriding DataDomainProvider.
> 
> Andrus
> 
> 
> 
>> On Feb 16, 2017, at 11:06 PM, Hugi Thordarson <hugi@karlmenn.is> wrote:
>> 
>> Can’t do that, the signature for put is ( String, <? extends String> ).
>> I've also tried a different method:
>> 
>> builder.addModule( binder -> binder.bindMap( Constants.PROPERTIES_MAP ).put( DataRowStore.SNAPSHOT_CACHE_SIZE_PROPERTY,
123456 ) );
>> 
>> …where I used an int, doesn’t work either.
>> 
>> - hugi
>> 
>> 
>>> On 16. feb. 2017, at 20:03, John Huss <johnthuss@gmail.com> wrote:
>>> 
>>> Maybe try using an int instead of the string "123456"?
>>> 
>>> On Thu, Feb 16, 2017 at 2:00 PM Hugi Thordarson <hugi@karlmenn.is> wrote:
>>> 
>>>> Hi all,
>>>> I’m attempting to change the size of the snapshot cache in code (not in
>>>> the project xml-file). It seems this should be set through a property,
>>>> right? Well, I’m just not managing to set properties in code. I’ve set
>>>> properties in code previously using something like the below, but they just
>>>> don’t seem to take?
>>>> 
>>>> builder.addModule( binder -> ServerModule.contributeProperties( binder
>>>> ).put( DataRowStore.SNAPSHOT_CACHE_SIZE_PROPERTY, "123456" ) )
>>>> 
>>>> Any ideas?
>>>> 
>>>> - hugi
>> 
> 


Mime
View raw message