Examples of beginTransaction()


Examples of org.b3log.solo.repository.LinkRepository.beginTransaction()

        link1.put(Link.LINK_TITLE, "link title");
        link1.put(Link.LINK_DESCRIPTION, "link description");
        link1.put(Link.LINK_ADDRESS, "link address");
        link1.put(Link.LINK_ORDER, link1Order);

        Transaction transaction = linkRepository.beginTransaction();
        linkRepository.add(link1);
        transaction.commit();

        Assert.assertNull(linkRepository.getByAddress("test"));
        Assert.assertNotNull(linkRepository.getByAddress("link address"));
View Full Code Here

Examples of org.b3log.solo.repository.OptionRepository.beginTransaction()

        final JSONObject option = new JSONObject();
        option.put(Keys.OBJECT_ID, Option.ID_C_BROADCAST_CHANCE_EXPIRATION_TIME);
        option.put(Option.OPTION_CATEGORY, Option.CATEGORY_C_BROADCAST);
        option.put(Option.OPTION_VALUE, 0L);

        Transaction transaction = optionRepository.beginTransaction();
        optionRepository.add(option);
        transaction.commit();

        Assert.assertEquals(optionRepository.count(), 1);
        Assert.assertNotNull(optionRepository.get(Option.ID_C_BROADCAST_CHANCE_EXPIRATION_TIME));
View Full Code Here

Examples of org.b3log.solo.repository.PageRepository.beginTransaction()

        page.put(Page.PAGE_COMMENTABLE, true);
        page.put(Page.PAGE_TYPE, "page");
        page.put(Page.PAGE_OPEN_TARGET, "_self");
        page.put(Page.PAGE_EDITOR_TYPE, "");

        final Transaction transaction = pageRepository.beginTransaction();
        pageRepository.add(page);
        transaction.commit();

        final List<JSONObject> pages = pageRepository.getPages();
        Assert.assertNotNull(pages);
View Full Code Here

Examples of org.b3log.solo.repository.PluginRepository.beginTransaction()

            new Object[] {event.getType(), plugins, PluginRefresher.class.getName()});

        final LatkeBeanManager beanManager = Lifecycle.getBeanManager();
        final PluginRepository pluginRepository = beanManager.getReference(PluginRepositoryImpl.class);
       
        final Transaction transaction = pluginRepository.beginTransaction();
       
        try {
            final PluginMgmtService pluginMgmtService = beanManager.getReference(PluginMgmtService.class);
           
            pluginMgmtService.refresh(plugins);
View Full Code Here

Examples of org.b3log.solo.repository.PreferenceRepository.beginTransaction()

            LOGGER.log(Level.INFO, "Sets repository[path={0}]", repositoryPath);
        }

        final PreferenceRepository preferenceRepository = PreferenceRepositoryImpl.getInstance();

        final Transaction transaction = preferenceRepository.beginTransaction();

        // Cache will be cleared manaully if necessary, see loadPreference.
        transaction.clearQueryCache(false);
        try {
            loadPreference();
View Full Code Here

Examples of org.b3log.solo.repository.TagArticleRepository.beginTransaction()

        final JSONObject tagArticle = new JSONObject();

        tagArticle.put(Article.ARTICLE + "_" + Keys.OBJECT_ID, "article1 id");
        tagArticle.put(Tag.TAG + "_" + Keys.OBJECT_ID, "tag1 id");

        final Transaction transaction = tagArticleRepository.beginTransaction();
        tagArticleRepository.add(tagArticle);
        transaction.commit();
    }
}
View Full Code Here

Examples of org.b3log.solo.repository.TagRepository.beginTransaction()

        tag.put(Tag.TAG_TITLE, "tag title1");
        tag.put(Tag.TAG_REFERENCE_COUNT, 1);
        tag.put(Tag.TAG_PUBLISHED_REFERENCE_COUNT, 0);

        final Transaction transaction = tagRepository.beginTransaction();
        tagRepository.add(tag);
        transaction.commit();
    }

    /**
 
View Full Code Here

Examples of org.b3log.solo.repository.UserRepository.beginTransaction()

        another.put(User.USER_PASSWORD, "pass1");
        another.put(User.USER_ROLE, Role.DEFAULT_ROLE);
        another.put(UserExt.USER_ARTICLE_COUNT, 0);
        another.put(UserExt.USER_PUBLISHED_ARTICLE_COUNT, 0);

        Transaction transaction = userRepository.beginTransaction();
        userRepository.add(another);
        transaction.commit();

        Assert.assertNull(userRepository.getAdmin());
View Full Code Here

Examples of org.compass.core.CompassSession.beginTransaction()

  }
 
  public void removeItem(Item item) {
    CompassSession compassSession = compass.openSession();
    CompassTransaction compassTransaction = compassSession.beginTransaction();
    String query = "+itemId:" + item.getItemId().toString();
    CompassHits hits = compassSession.find(query);
    Iterator<?> iterator = hits.detach().iterator();
    while (iterator.hasNext()) {
      DefaultCompassHit defaultCompassHit = (DefaultCompassHit) iterator.next();
View Full Code Here

Examples of org.eclipse.persistence.internal.sessions.AbstractSession.beginTransaction()

            if (commitManager.isProcessedCommit(object)) {
                return object;
            }
            commitManager.markPreModifyCommitInProgress(getObject());
            if (!isUnitOfWork) {
                session.beginTransaction();
            }
            ClassDescriptor descriptor = getDescriptor();
            DescriptorEventManager eventManager = descriptor.getEventManager();
            // PERF: Avoid events if no listeners.
            if (eventManager.hasAnyEventListeners()) {
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.