Examples of tx()


Examples of org.apache.kahadb.page.PageFile.tx()

            pageFile.flush();
           
            // Load up all the destinations since we need to scan all the indexes to figure out which journal files can be deleted.
            // Perhaps we should just keep an index of file
            storedDestinations.clear();
            pageFile.tx().execute(new Transaction.Closure<IOException>() {
                public void execute(Transaction tx) throws IOException {
                    for (Iterator<Entry<String, StoredDestination>> iterator = metadata.destinations.iterator(tx); iterator.hasNext();) {
                        Entry<String, StoredDestination> entry = iterator.next();
                        StoredDestination sd = loadStoredDestination(tx, entry.getKey(), entry.getValue().subscriptions!=null);
                        storedDestinations.put(entry.getKey(), sd);
View Full Code Here

Examples of org.apache.kahadb.page.PageFile.tx()

    private void loadPageFile() throws IOException {
        this.indexLock.writeLock().lock();
        try {
            final PageFile pageFile = getPageFile();
            pageFile.load();
            pageFile.tx().execute(new Transaction.Closure<IOException>() {
                public void execute(Transaction tx) throws IOException {
                    if (pageFile.getPageCount() == 0) {
                        // First time this is created.. Initialize the metadata
                        Page<Metadata> page = tx.allocate();
                        assert page.getPageId() == 0;
View Full Code Here

Examples of org.apache.kahadb.page.PageFile.tx()

                }
            });
            // Load up all the destinations since we need to scan all the indexes to figure out which journal files can be deleted.
            // Perhaps we should just keep an index of file
            storedDestinations.clear();
            pageFile.tx().execute(new Transaction.Closure<IOException>() {
                public void execute(Transaction tx) throws IOException {
                    for (Iterator<Entry<String, StoredDestination>> iterator = metadata.destinations.iterator(tx); iterator.hasNext();) {
                        Entry<String, StoredDestination> entry = iterator.next();
                        StoredDestination sd = loadStoredDestination(tx, entry.getKey(), entry.getValue().subscriptions!=null);
                        storedDestinations.put(entry.getKey(), sd);
View Full Code Here

Examples of org.fusesource.hawtdb.api.TxPageFile.tx()

    TxPageFile logDb           = (TxPageFile) arguments.get("logDb");
    Map<String, Object> result = new HashMap<>();

    if (logDb != null) {

      Transaction tx                            = logDb.tx();
      MultiIndexFactory multiIndexFactory       = new MultiIndexFactory(tx);
      IndexFactory<String, Object> indexFactory = new BTreeIndexFactory<>();

      try {
View Full Code Here

Examples of org.structr.core.app.App.tx()

  protected <T extends NodeInterface> List<T> createTestNodes(final Class<T> type, final int number) throws FrameworkException {

    final App app       = StructrApp.getInstance(securityContext);
    final List<T> nodes = new LinkedList<>();

    try (final Tx tx = app.tx()) {

      for (int i = 0; i < number; i++) {
        nodes.add(app.create(type));
      }
View Full Code Here

Examples of org.structr.core.app.App.tx()

    final List<TestOne> nodes = createTestNodes(TestOne.class, 2);
    final TestOne startNode   = nodes.get(0);
    final TestOne endNode     = nodes.get(1);
    final List<T> rels        = new LinkedList<>();

    try (final Tx tx = app.tx()) {

      for (int i = 0; i < number; i++) {

        rels.add((T)app.create(startNode, endNode, relType));
      }
View Full Code Here

Examples of org.structr.core.app.App.tx()

  protected <T extends NodeInterface> List<T> createTestNodes(final Class<T> type, final int number) throws FrameworkException {

    final App app       = StructrApp.getInstance(securityContext);
    final List<T> nodes = new LinkedList<>();

    try (final Tx tx = app.tx()) {

      for (int i = 0; i < number; i++) {
        nodes.add(app.create(type));
      }
View Full Code Here

Examples of org.structr.core.app.App.tx()

    final List<TestOne> nodes = createTestNodes(TestOne.class, 2);
    final TestOne startNode   = nodes.get(0);
    final TestOne endNode     = nodes.get(1);
    final List<T> rels        = new LinkedList<>();

    try (final Tx tx = app.tx()) {

      for (int i = 0; i < number; i++) {

        rels.add((T)app.create(startNode, endNode, relType));
      }
View Full Code Here

Examples of org.structr.core.app.App.tx()

    Tag top  = body.block("div").id("top");

    final App app  = StructrApp.getInstance(securityContext);
    final Tag left = body.block("div").id("left");

    try (final Tx tx = app.tx()) {

      for (SchemaNode node : app.nodeQuery(SchemaNode.class).getAsList()) {

        final String rawType = node.getName();
        top.inline("a").attr(new Href(restPath + "/" + rawType), new If(rawType.equals(currentType), new Css("active"))).text(rawType);
View Full Code Here

Examples of org.structr.core.app.App.tx()

          retry = true;
        }
      }

      // isolate write output
      try (final Tx tx = app.tx()) {
        result.commitResponse(gson.get(), response);
        tx.success();
      }

    } catch (FrameworkException frameworkException) {
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.