1. [转] 同步与异步 阻塞与非阻塞IO

    摘自:http://leili.iteye.com/blog/1580466

    2017/02/12 iteye

  2. jvisualVM profiling分析

    用jdk1.6自带的JVisualVM版本好像比较低,最好用比较新的,比如我用过1.3.1 2. to profile a remote app such as in a remote linux machine, we need to start JMX port in remote app as this way java -Dcom.sun.management.jmxremote.port=3333      -Dcom.sun.management.jmxremote.ssl=false      -Dcom.sun.management.jmxremote.authenticate=false      YourJavaApp 3. in jvisualVM client, 在 “远程” 节点下添加 远程主机名或者ip地址(不需要提供port) 在远程节点下将出现新添加的子节点。在子节点下可以继续添加“JMX”节点,提供远程主机的ip:port即可, port就是我们上面定义的3333 4.双击即可打开,在sampler tab可mornitor CPU运行时间基于方法,类,或者包名。从中可以发现那个所占CPU的比例高,再从中发现性能瓶颈。 5. 可以save snapshot方便事后分析,很有用。方便team一块分析,共享。

    2017/02/12 iteye

  3. Hibernate 小知识

    inverse在one-to-many和many-to-many中   inverse 默认值是false   根据hibernate reference所说: the non-inverse side is used to save the in-memory representation to the database. The non-inverse side即 inverse=false的那一端。一般one-to-many关系one端设置成inverse=true,也即由多方维护关系。一个好处是不会因为一方一次修改,多方所有相关记录都要更新;many-to-many关系可以任选一端设置成inverse=true.   2. unsaved-value null, any,none 主要是cascade insert/update时,判断对象链上的隐含对象是插入还是更新到数据库。一般pojo主键是对象时新建默认是null,这时进行插入;否则该pojo就是从数据库中load出来的pojo,需要进行更新。 关于none和any的设置不是很清楚。

    2017/02/12 iteye

  4. AJAX的几个问题

    我们知道流行的AJAX库帮我们解决了跨浏览器的DOM 查询,DOM操作,CSS操作,AJAX调用等问题。不知以下两个问题是怎么解决的:   1. 浏览器的back & forward问题,浏览器能记住在各个点上的AJAX操作吗?   2. 并发问题。因为AJAX应用的重要场景是异步调用。假如一个HTML页面上同时产生了两个AJAX调用Invoke1 和 Invoke2。它们的回调函数操作了同一个DOM对象。Invoke1首先调用,其次Invoke2。但是Invoke2首先执行完成返回到浏览器更新DOM对象,再接着是Invoke1返回覆盖了Invoke2更新过的DOM对象。也就是Invoke2的结果丢失了。     不知道目前兄弟们是怎么解决这两个问题的。 :)

    2017/02/12 iteye

  5. 高性能网站之数据库

    读写分离     一个主数据库负责写,多个从数据库负责读。主数据库数据单向同步到从数据库。  

    2017/02/12 iteye

  6. AJAX Cross-Domain Same-Origin Policy limitation

    AJAX Same-Origin Policy(SOP) limitation

    2017/02/12 iteye

  7. open session in view

    摘自:http://community.jboss.org/wiki/OpenSessioninView  

    2017/02/12 iteye

  8. CAP

    CAP理论   Eric Brewer , systems professor at the University of California, Berkeley, and at that time head of Inktomi, brought the different trade-offs together in a keynote address to the PODC (Principles of Distributed Computing) conference in 2000.1 He presented the CAP theorem, which states that of three properties of shared-data systems—data consistency, system availability, and tolerance to network partition —only two can be achieved at any given time.   Eventually Consistency one of the weak consistency. That is, if no more updates on the given object, accessing the object will always return the last updated value. Of couse, there is a time period between the update and all observers seeing the updated value, which called inconsistency Window.    

    2017/02/12 iteye