Package org.objectweb.speedo.pobjects.basic

Examples of org.objectweb.speedo.pobjects.basic.BasicA.writeF1()


        pm.currentTransaction().begin();
        final Object[] oids = new Object[NB_OBJECT];
        final Semaphore[] s = new Semaphore[NB_OBJECT];
        for(int i=0; i<NB_OBJECT; i++) {
            BasicA ba = new BasicA();
            ba.writeF1("testManyThreadConcurrentData_" + i);
            ba.writeF2(i);
            pm.makePersistent(ba);
            oids[i] = pm.getObjectId(ba);
            s[i] = new Semaphore();
        }
View Full Code Here


        //test concurrent loading in the same transaction
        BasicA ba = ((BasicA) pm.getObjectById(oids[NB_OBJECT-1], false));
        ba.readF1_F2();
       
        ba = ((BasicA) pm.getObjectById(oids[threadId], false));
        ba.writeF1(ba.readF1() + "modifiedBy" + threadId);
       
        for(int j=0; j<NB_MODIF; j++) {
            // Choose an object: alternativly on each side
            // of the threadId
            int id = j;
View Full Code Here

                id = Math.max(0, threadId - j);
            }
            ba = ((BasicA) pm.getObjectById(oids[id], false));
            s[id].P();
            try {
                ba.writeF1(ba.readF1() + "modifiedBy" + threadId);
            } finally {
                s[id].V();
            }
        }
       
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.