Package nexj.core.rpc.ra.tx

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


      j1 = perJournal.getJournal(makeXid(1))//NO COMPACT
      assertEquals(1, perJournal.getActiveTransactions());
      assertEquals(tempFile1, perJournal.getActiveJournal());
      j1.addRecord(new JournalRecordTesting(makeXid(1), FileJournalRecordCopyInsert.OPCODE));
      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());
View Full Code Here


      //     ---j2---COMPACT!
      //          ---j3--->COMPACT!
      j1 = perJournal.getJournal(makeXid(2))//NO COMPACT
      assertEquals(1, perJournal.getActiveTransactions());
      assertEquals(tempFile2, perJournal.getActiveJournal());
      j1.addRecord(new JournalRecordTesting(makeXid(2), FileJournalRecordCopyInsert.OPCODE));
      j1.flush();
      assertEquals(tempFile2, perJournal.getActiveJournal());
      assertTrue(tempFile2.length() > nZeroObjectsLength);
      assertEquals(nHeaderLength, tempFile1.length());
     
View Full Code Here

      j1 = perJournal.getJournal(makeXid(5))//NO COMPACT
      assertEquals(tempFile2, perJournal.getActiveJournal());
      assertEquals(nHeaderLength, tempFile1.length());
      assertEquals(nZeroObjectsLength, tempFile2.length());
     
      j1.addRecord(new JournalRecordTesting(makeXid(5), FileJournalRecordCopyInsert.OPCODE));
      j1.addRecord(new JournalRecordTesting(makeXid(5), JournalRecordPrepared.OPCODE));
      j1.flush();
      assertTrue(tempFile2.length() > nZeroObjectsLength);

      //CRASH
View Full Code Here

      assertEquals(tempFile2, perJournal.getActiveJournal());
      assertEquals(nHeaderLength, tempFile1.length());
      assertEquals(nZeroObjectsLength, tempFile2.length());
     
      j1.addRecord(new JournalRecordTesting(makeXid(5), FileJournalRecordCopyInsert.OPCODE));
      j1.addRecord(new JournalRecordTesting(makeXid(5), JournalRecordPrepared.OPCODE));
      j1.flush();
      assertTrue(tempFile2.length() > nZeroObjectsLength);

      //CRASH
      PersistentJournal.closeAll();
View Full Code Here

      assertEquals(new JournalRecordTesting(makeXid(5), FileJournalRecordCopyInsert.OPCODE), opsList.get(0));
      assertEquals(new JournalRecordTesting(makeXid(5), JournalRecordPrepared.OPCODE), opsList.get(1));
     
      //FORGET
      assertEquals(tempFile1, perJournal.getActiveJournal());
      j1.addRecord(new JournalRecordTesting(makeXid(5), JournalRecordCompleted.OPCODE));
      j1.flush();
      assertEquals(tempFile1, perJournal.getActiveJournal());
      j1.forget(makeXid(5))//COMPACT
      assertEquals(tempFile2, perJournal.getActiveJournal());
      assertEquals(nHeaderLength, tempFile1.length());
View Full Code Here

     
      //Make appropriate journal entry. (File, STATUS_READY)
      PersistentJournal pJournal = PersistentJournal.makeJournal(m_outgoingJournal);
      MemoryJournal journal = pJournal.getJournal(makeXid(7));
     
      journal.addRecord(new FileJournalRecordCopyInsert(makeXid(7),
         new File(m_outgoingTempDirectory, "outgoing.txt").getAbsolutePath(),
         new File(m_outgoingDirectory, "outgoing.txt").getAbsolutePath(),
         null, null));
     
      journal.addRecord(new FileJournalRecordMkTemp(makeXid(7),
View Full Code Here

      journal.addRecord(new FileJournalRecordCopyInsert(makeXid(7),
         new File(m_outgoingTempDirectory, "outgoing.txt").getAbsolutePath(),
         new File(m_outgoingDirectory, "outgoing.txt").getAbsolutePath(),
         null, null));
     
      journal.addRecord(new FileJournalRecordMkTemp(makeXid(7),
         new File(m_outgoingTempDirectory, "outgoing.txt").getAbsolutePath(),
         null));
     
      journal.addRecord(new JournalRecordPrepared(makeXid(7)));
     
View Full Code Here

     
      journal.addRecord(new FileJournalRecordMkTemp(makeXid(7),
         new File(m_outgoingTempDirectory, "outgoing.txt").getAbsolutePath(),
         null));
     
      journal.addRecord(new JournalRecordPrepared(makeXid(7)));
     
      journal.flush();
     
     
      //********** PROCESS CRASH RECOVERY **********
 
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.