Search in sources :

Example 11 with ParticipantStore

use of com.arjuna.ats.arjuna.objectstore.ParticipantStore in project narayana by jbosstm.

the class CachedTest method test.

@Test
public void test() throws Exception {
    int cacheSize = 2048;
    int threads = 100;
    Thread[] t = new Thread[threads];
    ObjectStoreEnvironmentBean objectStoreEnvironmentBean = arjPropertyManager.getObjectStoreEnvironmentBean();
    objectStoreEnvironmentBean.setCacheStoreSize(cacheSize);
    ParticipantStore store = new CacheStore(objectStoreEnvironmentBean);
    long stime = Calendar.getInstance().getTime().getTime();
    for (int i = 0; i < threads; i++) {
        System.err.println("i: " + i);
        t[i] = new ThreadWriter(store);
        t[i].start();
    }
    for (int j = 0; j < threads; j++) {
        System.err.println("j: " + j);
        t[j].join();
        assertTrue(((ThreadWriter) t[j]).passed);
    }
    long ftime = Calendar.getInstance().getTime().getTime();
    long timeTaken = ftime - stime;
    store.sync();
    System.err.println("time for " + threads + " users is " + timeTaken);
}
Also used : ObjectStoreEnvironmentBean(com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean) CacheStore(com.arjuna.ats.internal.arjuna.objectstore.CacheStore) ParticipantStore(com.arjuna.ats.arjuna.objectstore.ParticipantStore) Test(org.junit.Test)

Example 12 with ParticipantStore

use of com.arjuna.ats.arjuna.objectstore.ParticipantStore in project narayana by jbosstm.

the class JavaIdlRCManager method initialise.

private synchronized void initialise() {
    if (!_initialised) {
        _initialised = true;
        if (!_runWithoutDaemon) {
            try {
                ParticipantStore participantStore = StoreManager.getCommunicationStore();
                InputObjectState iState = participantStore.read_committed(new Uid(JavaIdlRCServiceInit.uid4Recovery), JavaIdlRCServiceInit.type());
                if (iState != null)
                    ref_ReCoo = iState.unpackString();
                else
                    jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_4();
            } catch (java.io.FileNotFoundException ex) {
                jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_4();
            } catch (Exception ex) {
                jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_5(ex);
            }
        }
    }
}
Also used : InputObjectState(com.arjuna.ats.arjuna.state.InputObjectState) Uid(com.arjuna.ats.arjuna.common.Uid) ParticipantStore(com.arjuna.ats.arjuna.objectstore.ParticipantStore) SystemException(org.omg.CORBA.SystemException)

Example 13 with ParticipantStore

use of com.arjuna.ats.arjuna.objectstore.ParticipantStore in project narayana by jbosstm.

the class JacOrbRCManager method initialise.

private final synchronized void initialise() {
    if (!_initialised) {
        _initialised = true;
        if (!_runWithoutDaemon) {
            try {
                ParticipantStore participantStore = StoreManager.getCommunicationStore();
                InputObjectState iState = participantStore.read_committed(new Uid(JacOrbRCServiceInit.uid4Recovery), JacOrbRCServiceInit.type());
                if (iState != null)
                    ref_ReCoo = iState.unpackString();
                else
                    jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_4();
            } catch (java.io.FileNotFoundException ex) {
                jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_4();
            } catch (Exception ex) {
                jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_5(ex);
            }
        }
    }
}
Also used : InputObjectState(com.arjuna.ats.arjuna.state.InputObjectState) Uid(com.arjuna.ats.arjuna.common.Uid) ParticipantStore(com.arjuna.ats.arjuna.objectstore.ParticipantStore) SystemException(org.omg.CORBA.SystemException)

Example 14 with ParticipantStore

use of com.arjuna.ats.arjuna.objectstore.ParticipantStore in project narayana by jbosstm.

the class JavaIdlRCManager method initialise.

private synchronized void initialise() {
    if (!_initialised) {
        _initialised = true;
        if (!_runWithoutDaemon) {
            try {
                ParticipantStore participantStore = StoreManager.getCommunicationStore();
                InputObjectState iState = participantStore.read_committed(new Uid(JavaIdlRCServiceInit.uid4Recovery), JavaIdlRCServiceInit.type());
                if (iState != null)
                    ref_ReCoo = iState.unpackString();
                else
                    jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_4();
            } catch (java.io.FileNotFoundException ex) {
                jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_4();
            } catch (Exception ex) {
                jtsLogger.i18NLogger.warn_orbspecific_jacorb_recoverycoordinators_JacOrbRCManager_5(ex);
            }
        }
    }
}
Also used : InputObjectState(com.arjuna.ats.arjuna.state.InputObjectState) Uid(com.arjuna.ats.arjuna.common.Uid) ParticipantStore(com.arjuna.ats.arjuna.objectstore.ParticipantStore) SystemException(org.omg.CORBA.SystemException)

Aggregations

ParticipantStore (com.arjuna.ats.arjuna.objectstore.ParticipantStore)14 Test (org.junit.Test)9 InputObjectState (com.arjuna.ats.arjuna.state.InputObjectState)7 OutputObjectState (com.arjuna.ats.arjuna.state.OutputObjectState)7 Uid (com.arjuna.ats.arjuna.common.Uid)6 ObjectStoreException (com.arjuna.ats.arjuna.exceptions.ObjectStoreException)4 PersistenceRecord (com.arjuna.ats.internal.arjuna.abstractrecords.PersistenceRecord)4 ExtendedObject (com.hp.mwtests.ts.arjuna.resources.ExtendedObject)4 ObjectStoreEnvironmentBean (com.arjuna.ats.arjuna.common.ObjectStoreEnvironmentBean)3 CacheStore (com.arjuna.ats.internal.arjuna.objectstore.CacheStore)3 PrintWriter (java.io.PrintWriter)3 SystemException (org.omg.CORBA.SystemException)3 DisposeRecord (com.arjuna.ats.internal.arjuna.abstractrecords.DisposeRecord)2 ByteArrayOutputStream (java.io.ByteArrayOutputStream)2 AtomicAction (com.arjuna.ats.arjuna.AtomicAction)1 CadaverActivationRecord (com.arjuna.ats.internal.arjuna.abstractrecords.CadaverActivationRecord)1 CadaverRecord (com.arjuna.ats.internal.arjuna.abstractrecords.CadaverRecord)1 ShadowingStore (com.arjuna.ats.internal.arjuna.objectstore.ShadowingStore)1 IOException (java.io.IOException)1 StringWriter (java.io.StringWriter)1