Package net.sf.joafip.service

Examples of net.sf.joafip.service.IExclusiveDataAccessSession.save()


        assertTrue("too much object state " + numberOfObjectState
            + ", count #" + count,
            numberOfObjectState < maxObjectState);
      }
    }
    session.save();
    assertFalse("must not be loaded",
        ProxyManager2.proxiedObjectIsLoaded(bigList));
    LOGGER.debug("--- save count " + saveCount);// NOPMD
    LOGGER.debug("--- set object ---");// NOPMD
    session.setObject("myBigList", bigList);
View Full Code Here


    LOGGER.debug("--- save count " + saveCount);// NOPMD
    LOGGER.debug("--- set object ---");// NOPMD
    session.setObject("myBigList", bigList);
    LOGGER.debug("--- save ---");// NOPMD
    bigList = null; // NOPMD no more reference the big list
    session.save(); // after this the garbage collector can free memory
    // of
    // the big list
    LOGGER.debug("--- iterate ---");// NOPMD
    bigList = (List<Integer>) session.getObject("myBigList"); // witchery
    // of
View Full Code Here

    List<Integer> bigList;
    final IInstanceFactory instanceFactory = session.getInstanceFactory();
    bigList = PLinkedList.newInstance(instanceFactory);

    session.save();
    assertTrue("must be a proxy", ProxyManager2.isProxyOrEnhanced(bigList));
    for (int count = 0; count < max; count++) {
      final int value = aValue(count);
      bigList.add(value); // this make bigList growing in memory
      if (count % 1000 == 999) {
View Full Code Here

    for (int count = 0; count < max; count++) {
      final int value = aValue(count);
      bigList.add(value); // this make bigList growing in memory
      if (count % 1000 == 999) {
        try {
          session.save();
        } catch (OutOfMemoryError error) {
          MEMORY_EATER.releaseMemory();
          final List<ObjectAndPersistInfo> list = filePersistence
              .getObjectAndPersistInfoOfObjectFromQueue();
          int weakCount = 0;
View Full Code Here

            + ", count #" + count,
            numberOfObjectState < maxObjectState);
      }
    }

    session.save();

    session.setObject("myBigList", bigList);
    bigList = null; // NOPMD no more reference the big list
    session.save(); // after this the garbage collector can free memory
            // of
View Full Code Here

    session.save();

    session.setObject("myBigList", bigList);
    bigList = null; // NOPMD no more reference the big list
    session.save(); // after this the garbage collector can free memory
            // of
    // the big list
    // witchery of lazy load: all the big list is not loaded in memory
    bigList = (List<Integer>) session.getObject("myBigList");
    int count = 0;
View Full Code Here

    bigList = (List<Integer>) session.getObject("myBigList");
    int count = 0;
    for (final int value : bigList) {
      doSomething(value);
      if (count % 1000 == 999) {
        session.save();
        final int numberOfObjectState = filePersistence
            .getNumberOfObjectState();
        assertTrue("too much object state " + numberOfObjectState
            + ", count #" + count,
            numberOfObjectState < maxObjectState);
View Full Code Here

    filePersistence.setMaintainedInMemoryEnabled(true);
    final IExclusiveDataAccessSession session = filePersistence
        .createExclusiveDataAccessSession();
    session.open();
    session.setObject("key1", new Object());
    session.save();
    session.setObject("key2", new Object());
    session.save();
    session.close();
    filePersistence.close();
  }
View Full Code Here

        .createExclusiveDataAccessSession();
    session.open();
    session.setObject("key1", new Object());
    session.save();
    session.setObject("key2", new Object());
    session.save();
    session.close();
    filePersistence.close();
  }
}
View Full Code Here

    garbageDataIntegrityChecker.check(filePersistence);

    final IInstanceFactory instanceFactory = session.getInstanceFactory();
    Bob1 bob1 = Bob1.newInstance(instanceFactory, true);
    bob1.setVal(10);
    session.save();

    assertTrue("must be unloaded", ProxyManager2.isUnloaded(bob1));
    final DataRecordIdentifier dataRecordIdentifier = filePersistence
        .getCurrentDataRecordIdentifierAssociatedToObject(bob1);
    assertNotNull("bob1 must be saved as a detached object",
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.