Package org.broadleafcommerce.common.util

Examples of org.broadleafcommerce.common.util.StreamCapableTransactionalOperationAdapter


            throw new IllegalArgumentException("Cannot purge carts since there was no configuration provided. " +
                    "In the absence of config params, all carts would be candidates for deletion.");
        }
        try {
            //The removal will be performed in chunks based on page size. This minimizes transaction times.
            transUtil.runStreamingTransactionalOperation(new StreamCapableTransactionalOperationAdapter() {
                @Override
                public void pagedExecute(Object[] param) throws Throwable {
                    List<Order> orders = (List<Order>) param[0];
                    for (Order cart : orders) {
                        deleteCart(cart);
View Full Code Here


            throw new IllegalArgumentException("Cannot purge customers since there was no configuration provided. " +
                    "In the absence of config params, all customers would be candidates for deletion.");
        }
        try {
            //The removal will be performed in chunks based on page size. This minimizes transaction times.
            transUtil.runStreamingTransactionalOperation(new StreamCapableTransactionalOperationAdapter() {
                @Override
                public void pagedExecute(Object[] param) throws Throwable {
                    List<Customer> customers = (List<Customer>) param[0];
                    for (Customer customer : customers) {
                        deleteCustomer(customer);
View Full Code Here

   
    protected Site retrieveSiteById(final Long id, final boolean persistentResult) {
      //Since the methods on this class are frequently called during regular page requests and transactions are expensive,
        //only run the operation under a transaction if there is not already an entity manager in the view
        final Site[] response = new Site[1];
        transUtil.runOptionalTransactionalOperation(new StreamCapableTransactionalOperationAdapter() {
            @Override
            public void execute() throws Throwable {
                Site site = siteDao.retrieve(id);
                if (persistentResult) {
                    response[0] = site;
View Full Code Here

   
    public Site retrieveSiteByDomainName(final String domainName, final boolean persistentResult) {
        //Since the methods on this class are frequently called during regular page requests and transactions are expensive,
        //only run the operation under a transaction if there is not already an entity manager in the view
        final Site[] response = new Site[1];
        transUtil.runOptionalTransactionalOperation(new StreamCapableTransactionalOperationAdapter() {
            @Override
            public void execute() throws Throwable {
                String domainPrefix = null;
                if (domainName != null) {
                    int pos = domainName.indexOf('.');
View Full Code Here

   
    protected Site retrieveDefaultSite(final boolean persistentResult) {
        //Since the methods on this class are frequently called during regular page requests and transactions are expensive,
        //only run the operation under a transaction if there is not already an entity manager in the view
        final Site[] response = new Site[1];
        transUtil.runOptionalTransactionalOperation(new StreamCapableTransactionalOperationAdapter() {
            @Override
            public void execute() throws Throwable {
                Site defaultSite = siteDao.retrieveDefaultSite();
                if (persistentResult) {
                    response[0] = defaultSite;
View Full Code Here

   
    protected List<Site> findAllSites(final boolean persistentResult) {
        //Since the methods on this class are frequently called during regular page requests and transactions are expensive,
          //only run the operation under a transaction if there is not already an entity manager in the view
          final List<Site> response = new ArrayList<Site>();
          transUtil.runOptionalTransactionalOperation(new StreamCapableTransactionalOperationAdapter() {
              @Override
              public void execute() throws Throwable {
                  List<Site> sites = siteDao.readAllActiveSites();
                  for (Site site : sites) {
                      if (persistentResult) {
View Full Code Here

TOP

Related Classes of org.broadleafcommerce.common.util.StreamCapableTransactionalOperationAdapter

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.