Package org.openrdf.sail

Examples of org.openrdf.sail.NotifyingSailConnection.begin()


            URI uriC = sail.getValueFactory().createURI("http://example.org/uriC");

            TestListener listener1 = new TestListener(), listener2 = new TestListener();
            NotifyingSailConnection sc = ((NotifyingSail) sail).getConnection();
            try {
                sc.begin();
                sc.clear();
                sc.commit();
                sc.begin();

                // Add a listener and add statements
View Full Code Here


            NotifyingSailConnection sc = ((NotifyingSail) sail).getConnection();
            try {
                sc.begin();
                sc.clear();
                sc.commit();
                sc.begin();

                // Add a listener and add statements
                sc.addConnectionListener(listener1);
                sc.addStatement(uriA, uriB, uriC, uriA);
                sc.addStatement(uriB, uriC, uriA, uriA);
View Full Code Here

                // Add a listener and add statements
                sc.addConnectionListener(listener1);
                sc.addStatement(uriA, uriB, uriC, uriA);
                sc.addStatement(uriB, uriC, uriA, uriA);
                sc.commit();
                sc.begin();

                // Add another listener and remove a statement
                sc.addConnectionListener(listener2);
                sc.removeStatements(uriA, null, null);
                sc.commit();
View Full Code Here

                // Add another listener and remove a statement
                sc.addConnectionListener(listener2);
                sc.removeStatements(uriA, null, null);
                sc.commit();
                sc.begin();

                assertEquals(2, listener1.getAdded());
                assertEquals(0, listener2.getAdded());
                assertEquals(1, listener1.getRemoved());
                assertEquals(1, listener2.getRemoved());
View Full Code Here

                // Remove a listener and clear
                sc.removeConnectionListener(listener1);
                sc.clear();
                sc.commit();
                sc.begin();

                assertEquals(1, listener1.getRemoved());
                assertEquals(2, listener2.getRemoved());
            } finally {
                sc.rollback();
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.