Examples of DatasetGraphTxn


Examples of com.hp.hpl.jena.tdb.transaction.DatasetGraphTxn

   
        @Override
        public Object call()
        {
          StoreConnection sConn = tts.getStoreConnection() ;
            DatasetGraphTxn dsg = null ;
            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) ;
                    // Eclispe Kepler (3.4) bug - otherwise the dsg.end() below
                    // gets a warning ("The variable dsg can only be null at this location")/
                    // which is wrong.
                    dsg.getClass() ;
                    if ( x1 != x2 )
                        log.warn(format("READER: %s Change seen: %d/%d : id=%d: i=%d", dsg.getTransaction().getLabel(),
                                        x1, x2, id, i)) ;
                    dsg.end() ;
                    log.debug("reader finish " + id + "/" + i) ;
                    dsg = null ;
                }
                return null ;
            } catch (RuntimeException ex)
            {
                ex.printStackTrace(System.err) ;
                if ( dsg != null )
                {
                    dsg.abort() ;
                    dsg.end() ;
                    dsg = null ;
                }
                return null ;
            }
        }
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.