Package nexj.core.rpc.ra.tx

Examples of nexj.core.rpc.ra.tx.MemoryJournal.completed()


      //(Completion will not be recorded if it has not been prepared)
      if (journal != null)
      {
         journal.addRecord(new JournalRecordCompleted(xid));
         journal.flush();
         journal.completed();
      }
   }


   /**
 
View Full Code Here


      MemoryJournal journal1 = perJournal.getJournal(xid1);
     
      journal1.addRecord(new JournalRecordTesting(xid1, FileJournalRecordCopyInsert.OPCODE));
      journal1.addRecord(new JournalRecordTesting(xid1, JournalRecordPrepared.OPCODE));
      journal1.flush();
      journal1.completed();
      journal1 = null;
     
     
      //Completed record (XID2) interleaved with record needing recovery (XID3)
      Xid xid2 = makeXid(2);
View Full Code Here

      journal2b.addRecord(new JournalRecordTesting(xid3, JournalRecordPrepared.OPCODE));
      journal2b.flush();
      journal2a.addRecord(new JournalRecordTesting(xid2, JournalRecordCompleted.OPCODE));
      journal2a.flush();
      journal2a.completed();
      journal2b.completed();
      journal2a = null;
      journal2b = null;
     
     
      //Repeated instructions; completed (XID4)
View Full Code Here

      journal3.addRecord(new JournalRecordTesting(xid4, JournalRecordPrepared.OPCODE));
      journal3.addRecord(new JournalRecordTesting(xid4, JournalRecordCompleted.OPCODE));
      journal3.addRecord(new JournalRecordTesting(xid4, JournalRecordPrepared.OPCODE));
      journal3.addRecord(new JournalRecordTesting(xid4, JournalRecordCompleted.OPCODE));
      journal3.flush();
      journal3.completed();
      journal3 = null;
     
     
      //Extraneous instructions; un-prepared (XID5), completed (XID6)
      Xid xid5 = makeXid(5);
View Full Code Here

      journal4a.addRecord(new JournalRecordTesting(xid5, FileJournalRecordDelete.OPCODE));
      journal4a.flush();
      journal4b.addRecord(new JournalRecordTesting(xid6, JournalRecordCompleted.OPCODE));
      journal4b.flush();
      journal4a.completed();
      journal4b.completed();
      journal4a = null;
      journal4b = null;
     
     
      //Just a PREPARED record by itself; recover (XID7)
View Full Code Here

      Xid xid7 = makeXid(7);
      MemoryJournal journal5 = perJournal.getJournal(xid7);
     
      journal5.addRecord(new JournalRecordTesting(xid7, JournalRecordPrepared.OPCODE));
      journal5.flush();
      journal5.completed();
      journal5 = null;
     
     
      //Just PREPARED and COMPLETED; completed (XID8)
      Xid xid8 = makeXid(8);
View Full Code Here

      MemoryJournal journal6 = perJournal.getJournal(xid8);
     
      journal6.addRecord(new JournalRecordTesting(xid8, JournalRecordPrepared.OPCODE));
      journal6.addRecord(new JournalRecordTesting(xid8, JournalRecordCompleted.OPCODE));
      journal6.flush();
      journal6.completed();
      journal6 = null;
     
     
      //Just COMPLETED; completed (XID9)
      Xid xid9 = makeXid(9);
View Full Code Here

      Xid xid9 = makeXid(9);
      MemoryJournal journal7 = perJournal.getJournal(xid9);
     
      journal7.addRecord(new JournalRecordTesting(xid9, JournalRecordCompleted.OPCODE));
      journal7.flush();
      journal7.completed();
      journal7 = null;
     
     
     
      /* ********** CRASH ********** */
 
View Full Code Here

      j1.addRecord(new JournalRecordTesting(makeXid(1), JournalRecordPrepared.OPCODE));
      j1.addRecord(new JournalRecordTesting(makeXid(1), JournalRecordCompleted.OPCODE));
      assertEquals(nZeroObjectsLength, tempFile1.length());
      j1.flush();
      assertTrue(tempFile1.length() > nZeroObjectsLength);
      j1.completed()//COMPACT
      assertEquals(0, perJournal.getActiveTransactions());
      assertEquals(tempFile2, perJournal.getActiveJournal());
      assertEquals(nZeroObjectsLength, tempFile2.length());
      assertEquals(nHeaderLength, tempFile1.length());
      j1 = null;
View Full Code Here

      assertEquals(tempFile1, perJournal.getActiveJournal());
      assertTrue(tempFile1.length() > nZeroObjectsLength)//first record still active!
      assertEquals(nHeaderLength, tempFile2.length());
      j2.addRecord(new JournalRecordTesting(makeXid(3), FileJournalRecordDelete.OPCODE));
      j2.flush();
      j1.completed()//COMPACT
      assertEquals(tempFile2, perJournal.getActiveJournal());
      assertEquals(nHeaderLength, tempFile1.length());
      assertTrue(tempFile2.length() > nZeroObjectsLength)//second record still active!
      j1 = null;
     
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.