Package com.hp.hpl.jena.tdb

Examples of com.hp.hpl.jena.tdb.StoreConnection


    public T_TransSystemMultiDatasets() {}
       
    //@Test
    public void manyRead()
    {
        final StoreConnection sConn = getStoreConnection() ;
        Callable<?> proc = new ReaderTx(this, 50, 200;        // Number of repeats, max pause
           
        for ( int i = 0 ; i < 5 ; i++ )
            execService.submit(proc) ;
        try
View Full Code Here


        }
   
        @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) ;
View Full Code Here

        }
       
        @Override
        public Object call()
        {
          StoreConnection sConn = tts.getStoreConnection() ;
            DatasetGraphTxn dsg = null ;
            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) ;
                    if ( x1+z != x2 )
                    {
                        TransactionManager txnMgr = dsg.getTransaction().getTxnMgr() ;
                        SysTxnState state = txnMgr.state() ;
                        String label = dsg.getTransaction().getLabel() ;
                        log.warn(format("WRITER: %s Change seen: %d + %d != %d : id=%d: i=%d", label, x1, z, x2, id, i)) ;
                        log.warn(state.toString()) ;
                        dsg.abort() ;
                        dsg.end() ;
                        dsg = null ;
                        return null ;
                    }
                    if (commit)
                        dsg.commit() ;
                    else
                        dsg.abort() ;
                    SysTxnState state = sConn.getTransMgrState() ;
                    log.debug(state.toString()) ;
                    log.debug("writer finish "+id+"/"+i) ;               
                    dsg.end() ;
                    dsg = null ;
                }
View Full Code Here

    public static void beforeClass()
    {
        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

    private StoreConnection sConn ;
    protected synchronized StoreConnection getStoreConnection()
    {
       
       
        StoreConnection sConn = StoreConnection.make(LOC) ;
        //sConn.getTransMgr().recording(true) ;
        return sConn ;
    }
View Full Code Here

    public T_TransSystem() {}
       
    //@Test
    public void manyRead()
    {
        final StoreConnection sConn = getStoreConnection() ;
        Callable<?> proc = new Reader(sConn, 50, 200;        // Number of repeats, max pause
           
        for ( int i = 0 ; i < 5 ; i++ )
            execService.submit(proc) ;
        try
View Full Code Here

    }
   
    //@Test
    public void manyReaderAndOneWriter()
    {
        final StoreConnection sConn = getStoreConnection() ;
       
        Callable<?> procR = new Reader(sConn, readerSeqRepeats, readerMaxPause) ;      // Number of repeats, max pause
        Callable<?> procW_a = new Writer(sConn, writerAbortSeqRepeats, writerMaxPause, false; // Number of repeats, max pause, commit.
        Callable<?> procW_c = new Writer(sConn, writerCommitSeqRepeats, writerMaxPause, true; // Number of repeats, max pause, commit.
View Full Code Here

    public static void beforeClass()
    {
        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

    private StoreConnection sConn ;
    protected synchronized StoreConnection getStoreConnection()
    {
       
       
        StoreConnection sConn = StoreConnection.make(LOC) ;
        //sConn.getTransMgr().recording(true) ;
        return sConn ;
    }
View Full Code Here

    public T_TransSystem() {}
       
    //@Test
    public void manyRead()
    {
        final StoreConnection sConn = getStoreConnection() ;
        Callable<?> proc = new Reader(sConn, 50, 200;        // Number of repeats, max pause
           
        for ( int i = 0 ; i < 5 ; i++ )
            execService.submit(proc) ;
        try
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.tdb.StoreConnection

Copyright © 2018 www.massapicom. 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.