Examples of executeInTransaction()


Examples of com.graphaware.tx.executor.single.SimpleTransactionExecutor.executeInTransaction()

    private void performMutations(GraphDatabaseService database) {
        SimpleTransactionExecutor executor = new SimpleTransactionExecutor(database);

        //create nodes
        executor.executeInTransaction(new VoidReturningCallback() {
            @Override
            protected void doInTx(GraphDatabaseService database) {
                database.createNode(label("SomeLabel1"));

                Node node1 = database.createNode(label("SomeLabel2"));
View Full Code Here

Examples of com.graphaware.tx.executor.single.SimpleTransactionExecutor.executeInTransaction()

                node3.setProperty("name", "Three");
            }
        });

        //create relationship
        executor.executeInTransaction(new VoidReturningCallback() {
            @Override
            protected void doInTx(GraphDatabaseService database) {
                Node one = database.getNodeById(1);
                Node two = database.getNodeById(2);
View Full Code Here

Examples of com.graphaware.tx.executor.single.SimpleTransactionExecutor.executeInTransaction()

                two.createRelationshipTo(one, withName("TEST"));
            }
        });

        //change and delete nodes
        executor.executeInTransaction(new VoidReturningCallback() {
            @Override
            protected void doInTx(GraphDatabaseService database) {
                database.getNodeById(3).delete();
                database.getNodeById(1).setProperty("name", "New One");
                database.getNodeById(1).setProperty("numbers", new int[]{1, 2, 3});
View Full Code Here

Examples of com.graphaware.tx.executor.single.SimpleTransactionExecutor.executeInTransaction()

                database.getNodeById(2).addLabel(label("NewLabel"));
            }
        });

        //change and delete relationships
        executor.executeInTransaction(new VoidReturningCallback() {
            @Override
            protected void doInTx(GraphDatabaseService database) {
                database.getNodeById(2).getSingleRelationship(withName("TEST"), OUTGOING).delete();

                database.getNodeById(1).getSingleRelationship(withName("TEST"), OUTGOING).setProperty("level", 3);
View Full Code Here

Examples of com.graphaware.tx.executor.single.SimpleTransactionExecutor.executeInTransaction()

    private void justForDocs() {
        GraphDatabaseService database = new TestGraphDatabaseFactory().newImpermanentDatabase(); //only for demo, use your own persistent one!
        TransactionExecutor executor = new SimpleTransactionExecutor(database);

        executor.executeInTransaction(new VoidReturningCallback() {
            @Override
            public void doInTx(GraphDatabaseService database) {
                database.createNode();
            }
        });
View Full Code Here

Examples of com.graphaware.tx.executor.single.TransactionExecutor.executeInTransaction()

    private void justForDocs() {
        GraphDatabaseService database = new TestGraphDatabaseFactory().newImpermanentDatabase(); //only for demo, use your own persistent one!
        TransactionExecutor executor = new SimpleTransactionExecutor(database);

        executor.executeInTransaction(new VoidReturningCallback() {
            @Override
            public void doInTx(GraphDatabaseService database) {
                database.createNode();
            }
        });
View Full Code Here

Examples of com.hp.hpl.jena.graph.TransactionHandler.executeInTransaction()

        try { th.begin(); th.commit(); } catch (UnsupportedOperationException x) {}
        /* */
        Command cmd = new Command()
        { @Override
            public Object execute() { return null; } };
            try { th.executeInTransaction( cmd ); }
            catch (UnsupportedOperationException x) {}
    }

    public void testExecuteInTransactionCatchesThrowable()
    {Graph g = getGraph();
View Full Code Here

Examples of com.hp.hpl.jena.graph.TransactionHandler.executeInTransaction()

    if (th.transactionsSupported())
    {
        Command cmd = new Command()
        { @Override
            public Object execute() throws Error { throw new Error(); } };
            try { th.executeInTransaction( cmd ); }
            catch (JenaException x) {}
    }
    }

    static final Triple [] tripleArray = tripleArray( "S P O; A R B; X Q Y" );
View Full Code Here

Examples of com.hp.hpl.jena.graph.TransactionHandler.executeInTransaction()

        try { th.begin(); th.commit(); } catch (UnsupportedOperationException x) {}
        /* */
        Command cmd = new Command()
        { @Override
            public Object execute() { return null; } };
            try { th.executeInTransaction( cmd ); }
            catch (UnsupportedOperationException x) {}
    }

    public void testExecuteInTransactionCatchesThrowable()
    {Graph g = getGraph();
View Full Code Here

Examples of com.hp.hpl.jena.graph.TransactionHandler.executeInTransaction()

    if (th.transactionsSupported())
    {
        Command cmd = new Command()
        { @Override
            public Object execute() throws Error { throw new Error(); } };
            try { th.executeInTransaction( cmd ); }
            catch (JenaException x) {}
    }
    }

    static final Triple [] tripleArray = tripleArray( "S P O; A R B; X Q Y" );
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.