When using GemFire programmatically (e.g. embedded), you can use the
CacheFactory API (server-side)...

// Peer Cache
Cache peerCache = new CacheFactory()
  .set("name", "server1")
*  .set("ALLOW_PERSISTENT_TRANSACTIONS", "true")*
  ...
  .create();

Otherwise, you would (normally) use the standard GemFire properties files (
gemfire.properties
<http://gemfire.docs.pivotal.io/docs-gemfire/reference/topics/gemfire_properties.html>
[0])
on the server (or a client for that matter) in 1 of the designated
locations...

* user home directory
* working directory of the GemFire Server process (as designated with
gfsh>start
server ... *--dir=...*; defaults to a sub-directory under Gfsh's working
directory named after the server (e.g. "server1")
* explicitly referenced in *Gfsh* start server command's *--properties-file*
=<absolute-or-relative-to-server-working-dir-path-to-gemfire-properties-file>
option
* Additionally, GemFire has another System property to specify the location
of the properties file *-DgemfirePropertyFile*=... (in fact, this is what
*Gfsh* uses under-the-hoood when forking the GemFire Server process
using 'start
server ... *--properties-file*').

Internally, the file would contain GemFire System properties without the "
gemfire." prefix, like so...

// gemfire.properties
name=server1
...

Unfortunately, I do not think you can set...

ALLOW_PERSISTENT_TRANSACTIONS=true

In a gemfire.properties file, due to ALLOW_PERSISTENT_TRANSACTIONS not
being 1 of the standard GemFire System properties
<http://gemfire.docs.pivotal.io/docs-gemfire/reference/topics/gemfire_properties.html>
 [0].

[0] -
http://gemfire.docs.pivotal.io/docs-gemfire/reference/topics/gemfire_properties.html


On Mon, Jan 18, 2016 at 2:46 PM, Rafal G. <[email protected]> wrote:

> I am using gfsh + start server (just as John has shown) currently and it
> does work. I was hoping for a more intuitive place, like gemfire.properties
> for example.
> Thanks for the hints on Spring Data GF but I will be using pure
> client/server mode (way too much data) so I think settings such properties
> on the client would not do it, would it?
>
> 2016-01-18 23:37 GMT+01:00 John Blum <[email protected]>:
>
>> Hi Rafal-
>>
>> The following reference from the GemFire User Guide shows setting this
>> GemFire System property via Gfsh on the command line...
>>
>>
>> http://gemfire.docs.pivotal.io/docs-gemfire/latest/developing/transactions/cache_transactions_by_region_type.html#concept_omy_341_wk
>>
>> Like so...
>>
>> gfsh start server --name=server1 --dir=server1_dir \
>> --J=-Dgemfire.ALLOW_PERSISTENT_TRANSACTIONS=true
>>
>>
>> Alternatively, when using Spring (Data GemFire) configuration meta-data
>> (e.g. XML), you can do the following...
>>
>> <util:properties id="gemfireProperties">
>>   <prop key="name">server1</prop>
>>   <prop key="mcast-port">0</prop>
>>   <prop key="log-level">warning</prop>
>> *  <prop key="ALLOW_PERSISTENT_TRANSACTIONS">true</prop>*
>> </util:properties>
>>
>> <gfe:cache properties-ref="gemfireProperties"/>
>>
>>
>> Or better yet, perhaps with Spring Java Configuration...
>>
>>
>> public class Config {
>>
>>    @Bean
>>    Properties gemfireProperties() {
>>       Properties gemfireProperties = new Properties();
>>
>>       gemfireProperties.setProperty("name", "server1");
>>       gemfireProperties.setProperty("mcast-port", "0");
>>       gemfireProperties.setProperty("log-level", "warning");
>> *      gemfireProperties.setProperty("ALLOW_PERSISTENT_TRANSACTIONS",
>> "true");*
>>
>>       return gemfireProperties;
>>    }
>>
>>    @Bean
>>    CacheFactoryBean gemfireCache() {
>>       CacheFactoryBean gemfireCache = new CacheFactoryBean();
>>
>>       gemfireCache.setLazyInitialize(false);
>>       gemfireCache.setProperties(gemfireProperties());
>>       gemfireCache.setUseBeanFactoryLocator(false);
>>
>>       return gemfireCache;
>>    }
>> }
>>
>> Hope this helps.
>>
>> Cheers,
>> John
>>
>>
>> On Mon, Jan 18, 2016 at 2:12 PM, Rafal G. <[email protected]>
>> wrote:
>>
>>> Hi,
>>>
>>> What is the best place to set: ALLOW_PERSISTENT_TRANSACTIONS property?
>>>
>>> Rafal
>>>
>>
>>
>>
>> --
>> -John
>> 503-504-8657
>> john.blum10101 (skype)
>>
>
>


-- 
-John
503-504-8657
john.blum10101 (skype)

Reply via email to