在编写Salesforce后台代码的时候,如果数据量比较大,或者需要与数据库的交互比较频繁的话,那么会抛出一些限制的异常,来提示你让你做进一步的修改。

有这些限制实质上是跟Salesforce是一个云计算平台有关,这个平台同时 host 多个不同的应用共不同的用户使用,那么去限定每个应用所能够访问的最大资源也是有他自身的合理性的。

1):  通过Log可以看到salesforce中的一些设定限制

2): 如何去避免和修改此类异常呢? 最常用的方法就是有如下几种

  • 不要在循环中去操作数据库,避免SOQL queries的数量大于100
  • 要用数据结构去缓存object的信息,然后一次性的去数据库中将所需要的信息获取出来(这里也要适度,因为还有一个query rows = 50000的限制)

3): 可以到这个链接中查看更加详细的信息 http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_gov_limits.htm

Understanding Execution Governors and Limits的更多相关文章

  1. HackerRank "Lucky Numbers"

    Great learning for me:https://www.hackerrank.com/rest/contests/master/challenges/lucky-numbers/hacke ...

  2. JavaScript js调用堆栈(一)

    本文主要介绍JavaScript程序内部的执行机制 首先先了解什么是执行上下文 执行上下文就是当前JavaScript代码被解析和执行是所在环境的抽象概念,JavaScript中运行任何的代码都是在执 ...

  3. 转 Oracle 12c: Managing Resources

    http://www.oracle-class.com/?p=3058 1. Introduction: Oracle database 12c comes with several Resource ...

  4. Understanding the ASP.NET MVC Execution Process

    https://docs.microsoft.com/en-us/aspnet/mvc/overview/older-versions-1/overview/understanding-the-asp ...

  5. Understanding Virtual Memory

    Understanding Virtual Memory by Norm Murray and Neil Horman Introduction Definitions The Life of a P ...

  6. Understanding JVM Internals---不得不转载呀

    http://www.cubrid.org/blog/dev-platform/understanding-jvm-internals/ http://architects.dzone.com/art ...

  7. Life Cycle of Thread – Understanding Thread States in Java

    Life Cycle of Thread – Understanding Thread States in Java 深入理解java线程生命周期. Understanding Life Cycle ...

  8. Understanding, Operating and Monitoring Apache Kafka

    Apache Kafka is an attractive service because it's conceptually simple and powerful. It's easy to un ...

  9. SharePoint Server 2010 & WorkFlow related Limits

    Today, I have come across different workflow related limits for SharePoint Server 2010. Limit Maximu ...

随机推荐

  1. 2小时入门Robot Framework

    1.介绍 1.1.介绍Robot Robot Framework是一个基于关键字驱动的自动化测试框架.通过该框架,测试人员可使用python封装关键字,并在非代码环境下使用关键字构建可被执行的测试用例 ...

  2. http get vs post

    http get vs post GET与POST方法有以下区别:(1) 在客户端,Get方式在通过URL提交数据,数据在URL中可以看到:POST方式,数据放置在HTML HEADER内提交.(2) ...

  3. 最近开始做Android了

    最近开始做Android,在学习的过程中发现找以前知识很不方便啊,于是决定以后还是把知识记录在博客里吧,说不定也能为他人提供参考!

  4. Java中的Comparable接口和Comparator接口

    Comparator位于包java.util下,比较器,是在集合外部定义排序.Comparable位于包java.lang下,代表当前对象可比较的,是在集合内部实现排序. Comparable代表一个 ...

  5. [android]如何使LinearLayout布局从右向左水平排列,而不是从左向右排列

    方法1: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:l ...

  6. 【leetcode】Same Tree(easy)

    Given two binary trees, write a function to check if they are equal or not. Two binary trees are con ...

  7. IOS - 首次启动程序出现的画面介绍

    1.在appdelegate.m中找到 “application:didFinishLaunchingWithOptions:” 通过NSUserDefaults 来进行判断 if (![[NSUse ...

  8. IOS - 控件的AutoresizingMask属性

    在 UIView 中有一个autoresizingMask的属性,它对应的是一个枚举的值(如下),属性的意思就是自动调整子控件与父控件中间的位置,宽高. enum {   UIViewAutoresi ...

  9. 编写一个程序,求s=1+(1+2)+(1+2+3)+…+(1+2+3+…+n)的值

    编写一个程序,求s=1+(1+2)+(1+2+3)+…+(1+2+3+…+n)的值 1 #import <Foundation/Foundation.h>  2   3 int main( ...

  10. iOS应用架构谈(二):View层的组织和调用方案(上)

    OS客户端应用架构看似简单,但实际上要考虑的事情不少.本文作者将以系列文章的形式来回答iOS应用架构中的种种问题,本文是其中的第二篇,主要讲View层的组织和调用方案.上篇主要讲View层的代码结构. ...