Search in sources :

Example 6 with GeronimoTransactionManager

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();
}
Also used : NamedXAResource(org.apache.geronimo.transaction.manager.NamedXAResource) XAResource(javax.transaction.xa.XAResource) HOWLLog(org.apache.geronimo.transaction.log.HOWLLog) GeronimoTransactionManager(org.apache.geronimo.transaction.manager.GeronimoTransactionManager) File(java.io.File) XidFactory(org.apache.geronimo.transaction.manager.XidFactory) Ignore(org.junit.Ignore) Test(org.junit.Test)

Example 7 with GeronimoTransactionManager

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);
}
Also used : GeronimoTransactionManager(org.apache.geronimo.transaction.manager.GeronimoTransactionManager) InitialContext(javax.naming.InitialContext)

Aggregations

GeronimoTransactionManager (org.apache.geronimo.transaction.manager.GeronimoTransactionManager)7 Executor (java.util.concurrent.Executor)2 BootstrapContext (javax.resource.spi.BootstrapContext)2 ResourceAdapterInternalException (javax.resource.spi.ResourceAdapterInternalException)2 DataSource (javax.sql.DataSource)2 GeronimoBootstrapContext (org.apache.geronimo.connector.GeronimoBootstrapContext)2 GeronimoWorkManager (org.apache.geronimo.connector.work.GeronimoWorkManager)2 TransactionContextHandler (org.apache.geronimo.connector.work.TransactionContextHandler)2 OpenEJBException (org.apache.openejb.OpenEJBException)2 ByteArrayInputStream (java.io.ByteArrayInputStream)1 File (java.io.File)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 InvalidObjectException (java.io.InvalidObjectException)1 ObjectStreamException (java.io.ObjectStreamException)1 Serializable (java.io.Serializable)1 Type (java.lang.reflect.Type)1 MalformedURLException (java.net.MalformedURLException)1 URISyntaxException (java.net.URISyntaxException)1 URL (java.net.URL)1