Package com.db4o

Examples of com.db4o.ObjectContainer.commit()


      List<Counter> counterSet = fObjectContainer.query(Counter.class);
      Counter counter = counterSet.iterator().next();
      fObjectContainer.activate(counter, Integer.MAX_VALUE);
      db.ext().set(counter, Integer.MAX_VALUE);

      db.commit();
  }

  private Configuration createConfiguration() {
    Configuration config = Db4o.newConfiguration();
    //TODO We can use dbExists to configure our parameters for a more
View Full Code Here


    for (Preference pref : oc.query(Preference.class)) {
      oc.activate(pref, Integer.MAX_VALUE);
      oc.ext().set(convertPref(pref), Integer.MAX_VALUE);
      oc.delete(pref);
    }
    oc.commit();
    /* 20 */
    progressMonitor.worked(10);

    for (org.rssowl.core.persist.ISearchField searchField : oc.query(org.rssowl.core.internal.persist.SearchField.class))   {
      oc.activate(searchField, Integer.MAX_VALUE);
View Full Code Here

      String entityName = searchField.getEntityName();
      entityName = entityName.replace("core.model.types", "core.persist");
      MigrationHelper.setField(searchField, "fEntityName", entityName);
      oc.ext().set(searchField, Integer.MAX_VALUE);
    }
    oc.commit();
    /* 30 */
    progressMonitor.worked(10);

    for (org.rssowl.core.persist.ISearchCondition searchCond : oc.query(org.rssowl.core.internal.persist.SearchCondition.class))   {
      oc.activate(searchCond, Integer.MAX_VALUE);
View Full Code Here

      int searchSpecOrdinal = searchCond.getSpecifier().ordinal();
      org.rssowl.core.persist.SearchSpecifier searchSpec = org.rssowl.core.persist.SearchSpecifier.values()[searchSpecOrdinal];
      MigrationHelper.setField(searchCond, "fSpecifier", searchSpec);
      oc.ext().set(searchCond, Integer.MAX_VALUE);
    }
    oc.commit();
    /* 40 */
    progressMonitor.worked(10);

    List<org.rssowl.core.persist.IFolder> folders = new ArrayList<org.rssowl.core.persist.IFolder>();
    for (org.rssowl.core.persist.IFolder folder : oc.query(org.rssowl.core.internal.persist.Folder.class))   {
View Full Code Here

    /* Only save folders once they have all been updated */
    for (org.rssowl.core.persist.IMark mark : marks)   {
      oc.ext().set(mark, Integer.MAX_VALUE);
    }

    oc.commit();
    /* 80 */
    progressMonitor.worked(40);

    for (Map.Entry<Long, Map<String, ?>> entry : idPropertiesMap.entrySet()) {
      Query query = oc.query();
View Full Code Here

    progressMonitor.beginTask(Messages.Migration2To5_MIGRATING_DATA, totalProgress);

    ObjectContainer oc = Db4o.openFile(configFactory.createConfiguration(), dbFileName);

    totalProgressIncremented = Migration2To3.migrate(progressMonitor, totalProgress, totalProgressIncremented, oc);
    oc.commit();
    oc.close();

    File dbLastBackUpFile = DBManager.getDefault().getDBLastBackUpFile();
    dbLastBackUpFile.delete();
View Full Code Here

    progressMonitor.beginTask(Messages.Migration2To3_MIGRATING_DATA, totalProgress);

    ObjectContainer oc = Db4o.openFile(configFactory.createConfiguration(), dbFileName);

    totalProgressIncremented = migrate(progressMonitor, totalProgress, totalProgressIncremented, oc);
    oc.commit();
    oc.close();

    progressMonitor.worked(totalProgress - totalProgressIncremented);

    return new MigrationResult(false, false, false);
View Full Code Here

        addNewsCounterItem(newsCounter, feed);
        destinationDb.ext().store(feed, Integer.MAX_VALUE);

        ++feedCounter;
        if (feedCounter % 40 == 0) {
          destinationDb.commit();
          System.gc();
        }

        monitor.worked(chunk);
      }
View Full Code Here

        }

        monitor.worked(chunk);
      }
      allFeeds = null;
      destinationDb.commit();
      System.gc();
    } else
      monitor.worked(available);

    /* Back to normal subtask label */
 
View Full Code Here

        sourceDb.activate(description, Integer.MAX_VALUE);
        destinationDb.ext().store(description, Integer.MAX_VALUE);

        ++descriptionCounter;
        if (descriptionCounter % 600 == 0) {
          destinationDb.commit();
          System.gc();
        }

        monitor.worked(chunk);
      }
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.