Examples of StreamCapableTransactionalOperationAdapter


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

Examples of org.broadleafcommerce.common.util.StreamCapableTransactionalOperationAdapter

            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

Examples of org.broadleafcommerce.common.util.StreamCapableTransactionalOperationAdapter

   
    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

Examples of org.broadleafcommerce.common.util.StreamCapableTransactionalOperationAdapter

   
    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

Examples of org.broadleafcommerce.common.util.StreamCapableTransactionalOperationAdapter

   
    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

Examples of org.broadleafcommerce.common.util.StreamCapableTransactionalOperationAdapter

   
    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
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.