在编写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. Binary Tree Longest Consecutive Sequence

    Given a binary tree, find the length of the longest consecutive sequence path (连续的路径,不是从小到大). The pa ...

  2. 【leetcode】Symmetric Tree

    Symmetric Tree Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its ...

  3. Linux设置交换分区swap

    参考: http://www.vpser.net/opt/vps-add-swap.html https://www.zntec.cn/archives/vps-swap.html http://yz ...

  4. DataTemplate应用

    在WPF中,决定数据外观的是DataTemplate,即DataTemplate是数据内容的表现形式,一条数据显示成什么样子,是简单的文本还是直观的图形,就是由DataTemplate决定的.下面通过 ...

  5. Java for LeetCode 223 Rectangle Area

    Find the total area covered by two rectilinear rectangles in a 2D plane. Each rectangle is defined b ...

  6. json格式

    $.post('text.action',{....},function(datas){ var name=datas.data[0].name; }); 如果是多个还可以用循环获取.$.post(' ...

  7. JQuery 鼠标事件简介

    mouseover事件于用户把鼠标从一个元素移动到另外一个元素上时触发,mouseout事件于用户把鼠标移出一个元素时触发. 下面为你详细介绍下jquery中的鼠标事件: (1):click事件:cl ...

  8. oracle定时器,调用存储过程,定时从n张表中取值新增到本地一张表中

    --创建新增本地数据库的存储过程create or replaceprocedure pro_electric_record as  begin    insert into electric_met ...

  9. 【轮子】发现一个效果丰富酷炫的Android动画库

    没有什么比发现一个好轮子更让人开心的了. 这个库分分钟提高交互体验 :AndroidViewAnimations 一张图说明一切 配置和使用也相当简单 GitHub地址

  10. springMVC创建基础变量

    在springMVC中有一些变量是基础变量,可以在全局多个地方使用,在修改规则的时候,这样只用修改一个地方就好了,而且可以避免很多不必要的bug出现下面就来总结一下在我的项目中如何去创建一个全局基础变 ...