Package com.hp.hpl.jena.tdb

Examples of com.hp.hpl.jena.tdb.StoreConnection.begin()


        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
        assertFalse(dsgR2.contains(q1)) ;
        assertFalse(dsgR2.contains(q2)) ;
        dsgR2.end() ;
       
        DatasetGraphTxn dsgW1 = sConn.begin(ReadWrite.WRITE) ;
        dsgW1.add(q1) ;
        dsgW1.add(q2) ;
        dsgW1.commit() ;
        dsgW1.end() ;
View Full Code Here


   
    @Test public void trans_readBlock_01()
    {
        // READ(start)-WRITE(commit)-READ(finish)-check
        StoreConnection sConn = getStoreConnection() ;
        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
       
        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
       
        dsgW.add(q) ;
        dsgW.commit() ;
View Full Code Here

    {
        // READ(start)-WRITE(commit)-READ(finish)-check
        StoreConnection sConn = getStoreConnection() ;
        DatasetGraphTxn dsgR1 = sConn.begin(ReadWrite.READ) ;
       
        DatasetGraphTxn dsgW = sConn.begin(ReadWrite.WRITE) ;
       
        dsgW.add(q) ;
        dsgW.commit() ;
        dsgW.end() ;
       
View Full Code Here

                @Override
                public void run() {
                    try {
                        if (numberGenerator.nextInt(2) == 0) {
                            DatasetGraphTxn txnGraph =
                                    storeConnection.begin(ReadWrite.WRITE);
                            txnGraph.add(new Quad(
                                    Node.createURI("http://openjena.org/"
                                            + numberGenerator.nextInt()),
                                    Node.createURI("http://openjena.org/"
                                            + numberGenerator.nextInt()),
View Full Code Here

                            txnGraph.commit();
                            txnGraph.end();
                            nbQuadruplesAdded.incrementAndGet();
                        } else {
                            DatasetGraphTxn txnGraph =
                                    storeConnection.begin(ReadWrite.READ);
                            txnGraph.find(Node.ANY, Node.ANY, Node.ANY, Node.ANY);
                            //Iterator<Quad> iter = txnGraph.find(Node.ANY, Node.ANY, Node.ANY, Node.ANY);
                            //Iter.count(iter) ; // Consume
                            txnGraph.end();
                        }
View Full Code Here

        } finally {
            executor.shutdown();
        }

        DatasetGraphTxn txnGraph =
                storeConnection.begin(ReadWrite.READ);
        Iterator<Quad> result = txnGraph.find(
                Node.ANY, Node.ANY, Node.ANY, Node.ANY);
       
        long count = 0;
        while (result.hasNext()) {
View Full Code Here

            try
            {
                int id = gen.incrementAndGet() ;
                for (int i = 0; i < repeats; i++)
                {
                    dsg = sConn.begin(ReadWrite.READ) ;
                    log.debug("reader start " + id + "/" + i) ;

                    int x1 = count("SELECT * { ?s ?p ?o }", dsg) ;
                    pause(maxpause) ;
                    int x2 = count("SELECT * { ?s ?p ?o }", dsg) ;
View Full Code Here

            try {
                int id = gen.incrementAndGet() ;
                for ( int i = 0 ; i < repeats ; i++ )
                {
                    log.debug("writer start "+id+"/"+i) ;               
                    dsg = sConn.begin(ReadWrite.WRITE) ;

                    int x1 = count("SELECT * { ?s ?p ?o }", dsg) ;
                    int z = change(dsg, id, i) ;
                    pause(maxpause) ;
                    int x2 = count("SELECT * { ?s ?p ?o }", dsg) ;
View Full Code Here

    {
        if ( ! LOC.isMem() )
            FileOps.clearDirectory(LOC.getDirectoryPath()) ;
        StoreConnection.reset() ;
        StoreConnection sConn = StoreConnection.make(LOC) ;
        DatasetGraphTxn dsg = sConn.begin(ReadWrite.WRITE) ;
        dsg.add(q1) ;
        dsg.add(q2) ;
        initCount = 2 ;
        dsg.commit() ;
        dsg.end() ;
View Full Code Here

        //**** Not hitting the queue ****
        // Order of tweaking counters?
        // also writer and counters?
       
        DatasetGraphTxn dsgR2 = sConn.begin(ReadWrite.READ) ;
        assertTrue(dsgR2.contains(q)) ;
        dsgR2.end() ;
       
        DatasetGraph dsg = sConn.getBaseDataset() ;
        assertTrue(dsg.contains(q)) ;
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.