Package org.apache.openjpa.kernel

Examples of org.apache.openjpa.kernel.StoreManager


      for (int i = 0; i < owner._queries.size(); i++) {
                // if replicated, then execute only on single slice
        if (isReplicated && !usedExecutors.isEmpty()) {
          break;
        }
                StoreManager sm = owner.getDistributedStore().getSlice(i);
        if (!targets.contains(sm))
          continue;
        StoreQuery query = owner._queries.get(i);
        Executor executor = executors.get(i);
        if (!targets.contains(sm))
View Full Code Here


      for (int i = 0; i < owner._queries.size(); i++) {
                // if replicated, then execute only on single slice
        if (isReplicated && !usedExecutors.isEmpty()) {
          break;
        }
                StoreManager sm = owner.getDistributedStore().getSlice(i);
        if (!targets.contains(sm))
          continue;
                QueryExecutor call = new QueryExecutor();
                call.executor = executors.get(i);
                call.query = owner._queries.get(i);
View Full Code Here

      List<Future<Number>> futures = new ArrayList<Future<Number>>();
      int result = 0;
            ExecutorService threadPool = SliceThread.getPool();
      List<SliceStoreManager> targets = findTargets();
      for (int i = 0; i < owner._queries.size(); i++) {
                StoreManager sm = owner.getDistributedStore().getSlice(i);
        if (!targets.contains(sm))
          continue;
       
        DeleteExecutor call = new DeleteExecutor();
        call.executor = executors.get(i);
View Full Code Here

        createData();
    }

    public void test() {
        OpenJPAEntityManagerSPI em = emf.createEntityManager();
        StoreManager store = ((EntityManagerImpl) em).getBroker().getStoreManager().getDelegate();

        FetchPlan fp = getFetchPlan(em);
        try {
            sql.clear();
View Full Code Here

      for (int i = 0; i < owner._queries.size(); i++) {
                // if replicated, then execute only on single slice
        if (isReplicated && !usedExecutors.isEmpty()) {
          break;
        }
                StoreManager sm = owner.getDistributedStore().getSlice(i);
        if (!targets.contains(sm))
          continue;
        StoreQuery query = owner._queries.get(i);
        Executor executor = executors.get(i);
        if (!targets.contains(sm))
View Full Code Here

      for (int i = 0; i < owner._queries.size(); i++) {
                // if replicated, then execute only on single slice
        if (isReplicated && !usedExecutors.isEmpty()) {
          break;
        }
                StoreManager sm = owner.getDistributedStore().getSlice(i);
        if (!targets.contains(sm))
          continue;
        StoreQuery query = owner._queries.get(i);
        Executor executor = executors.get(i);
        if (!targets.contains(sm))
View Full Code Here

      for (int i = 0; i < owner._queries.size(); i++) {
                // if replicated, then execute only on single slice
        if (isReplicated && !usedExecutors.isEmpty()) {
          break;
        }
                StoreManager sm = owner.getDistributedStore().getSlice(i);
        if (!targets.contains(sm))
          continue;
        StoreQuery query = owner._queries.get(i);
        Executor executor = executors.get(i);
        if (!targets.contains(sm))
View Full Code Here

    }

    public Collection<Exception> flush() {
        Collection<Exception> errors = null;
        // skip past any delegating store managers.
        StoreManager storeManager =
            _broker.getStoreManager().getInnermostDelegate();
        Collection<OpenJPAStateManager> sms = null;
        if (_cache != null && !_cache.isEmpty()) {
            // TODO lock or switch the cache
            sms = _cache.getStateManagers();
            _cache.clear();
        }
        if (sms != null && !sms.isEmpty()) {
            storeManager.retainConnection();
            storeManager.begin();
            errors = storeManager.flush(sms);
            if(errors != null && !errors.isEmpty() ) {
                for(Exception e : errors) {
                    // TODO add error handling.
                    e.printStackTrace();
                }
            }
            storeManager.commit();
            storeManager.releaseConnection();
        }
        return errors;
    }
View Full Code Here

TOP

Related Classes of org.apache.openjpa.kernel.StoreManager

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.