use of org.apache.geronimo.transaction.manager.GeronimoTransactionManager in project aries by apache.
the class LogTest method testGeronimo.
@Test
@Ignore
public void testGeronimo() throws Exception {
System.err.println("Geronimo");
XidFactory xidFactory = new XidFactoryImpl("hi".getBytes());
HOWLLog txLog = new HOWLLog("org.objectweb.howl.log.BlockLogBuffer", 4, true, true, 50, new File(".").getAbsolutePath(), "log", "geronimo", 512, 0, 2, 4, -1, true, xidFactory, null);
txLog.doStart();
GeronimoTransactionManager tm = new GeronimoTransactionManager(600, xidFactory, txLog);
XAResource xar1 = new TestXAResource("res1");
XAResource xar2 = new TestXAResource("res2");
tm.registerNamedXAResourceFactory(new TestXAResourceFactory("res1"));
tm.registerNamedXAResourceFactory(new TestXAResourceFactory("res2"));
for (int i = minThreads; i <= maxThreads; i *= 10) {
for (int j = minTxPerThread; j <= maxTxPerThread; j *= 10) {
long ms = testThroughput(tm, xar1, xar2, i, j);
System.err.println("TPS (" + i + " threads, " + j + " tx) = " + ((i * j) / (ms / 1000.0)));
}
}
txLog.doStop();
System.err.println();
System.err.flush();
}
use of org.apache.geronimo.transaction.manager.GeronimoTransactionManager in project tomee by apache.
the class JpaTest method setUp.
public void setUp() throws Exception {
super.setUp();
// setup tx mgr
transactionManager = new GeronimoTransactionManager();
SystemInstance.get().setComponent(TransactionSynchronizationRegistry.class, transactionManager);
// setup naming
MockInitialContextFactory.install(Collections.singletonMap("java:comp/TransactionSynchronizationRegistry", transactionManager));
assertSame(transactionManager, new InitialContext().lookup("java:comp/TransactionSynchronizationRegistry"));
// Put tx mgr into SystemInstance so OpenJPA can find it
SystemInstance.get().setComponent(TransactionManager.class, transactionManager);
// init databases
jtaDs = createJtaDataSource(transactionManager);
nonJtaDs = createNonJtaDataSource();
initializeDatabase(jtaDs);
}
Aggregations