How to enable high replication data store on local dev_appserver?

I am using the latest Java SDK 1.7.4 and the following command to start the dev server:

%java.home%\bin\java -Ddatastore.default_high_rep_job_policy_unapplied_job_pct=20 -cp "%~dp0\..\lib\appengine-tools-api.jar" ^ com.google.appengine.tools.KickStart ^ com.google.appengine.tools.development.DevAppServerMain %* 

("datastore.default_high_rep_job_policy_unapplied_job_pct = 20", as in https://developers.google.com/appengine/docs/java/tools/devserver#Using_the_Datastore )

However, the magazine says on first request at the Datastore:

 INFO: Local Datastore initialized: Type: Master/Slave 

Then I get an exception:

 31.01.2013 19:16:02 org.datanucleus.transaction.Transaction rollback SEVERE: Operation rollback failed on resource: org.datanucleus.store.appengine.DatastoreXAResource@404eb2 , error code UNKNOWN and transaction: [DataNucleus Transaction, ID=Xid= , enlisted resources=[ org.datanucleus.store.appengine.DatastoreXAResource@404eb2 ]] 31.01.2013 19:16:02 com.google.apphosting.utils.jetty.JettyLogger warn WARNING: /themepark/post java.lang.IllegalArgumentException: transactions on multiple entity groups only allowed in High Replication applications 

I have the following lines in \META-INF\jdoconfig.xml to enable transaction between groups (XG):

 <property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/> <property name="datanucleus.appengine.datastoreEnableXGTransactions" value="true"/> 

How to make dev_appserver.cmd emulate a highly replicated data warehouse?

+4
source share
1 answer

UPDATE:

Use dev_appserver.cmd to pass in the argument and run your code as follows:

dev_appserver --jvm_flag=-Ddatastore.default_high_rep_job_policy_unapplied_job_pct=20 <path_to_war_dir>

You can try including --jvm_flag=-Ddatastore.default_high_rep_job_policy_unapplied_job_pct=20 at the end of your dev_appserver.cmd file if you want (right before %* )

OLD:

Add the following to your command line:

-Ddatastore.default_high_rep_job_policy_unapplied_job_pct=20

This is one of the first things that are covered here (as well as other methods you can use): https://developers.google.com/appengine/docs/java/tools/devserver#Using_the_Datastore

+2
source

All Articles