Uygulama motoru java jdo'da çapraz grup işlemi var.Birim Testi XG Cross Grup Transferi Uygulama Altyapısı Java JDO
Yerel dev uygulama motoru sunucusunda harika çalışıyor. Ancak, birim testinden java.lang.IllegalArgumentException: transactions on multiple entity groups only allowed in High Replication applications
aldım.
LocalServiceTestHelper kullanarak bir Yüksek Çoğaltma Uygulaması taklit edilebilir mi?
1.6.6 kullanıyorum.
public class Ds2Test {
private final LocalServiceTestHelper helper =
new LocalServiceTestHelper(new LocalDatastoreServiceTestConfig());
private static final PersistenceManagerFactory pmfXgInstance =
JDOHelper.getPersistenceManagerFactory("xg-transactions");
@Before
public void setUp() {
helper.setUp();
}
@After
public void tearDown() {
helper.tearDown();
}
@Test
public void testXgTransaction() throws Exception {
PersistenceManager xgPm = pmfXgInstance.getPersistenceManager();
Transaction xgTx = xgPm.currentTransaction();
xgTx.begin();
xgTx.commit();
xgPm.close();
}
}
Ve burada jdoconfig.xml yapılandırma geçerli::
<persistence-manager-factory name="xg-transactions">
<property name="javax.jdo.PersistenceManagerFactoryClass"
value="org.datanucleus.store.appengine.jdo.DatastoreJDOPersistenceManagerFactory"/>
<property name="javax.jdo.option.ConnectionURL" value="appengine"/>
<property name="javax.jdo.option.NontransactionalRead" value="true"/>
<property name="javax.jdo.option.NontransactionalWrite" value="true"/>
<property name="javax.jdo.option.RetainValues" value="true"/>
<property name="datanucleus.appengine.autoCreateDatastoreTxns" value="true"/>
<property name="datanucleus.appengine.datastoreEnableXGTransactions" value="true"/>
</persistence-manager-factory>
İstisna xgTx.begin();