<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    honzeland

    記錄點滴。。。

    常用鏈接

    統(tǒng)計

    Famous Websites

    Java

    Linux

    P2P

    最新評論

    2010年3月1日 #

    Interesting books read or being read

    Oracle Performance Tuning for 10gR2, Second Edition -- http://www.amazon.com/Oracle-Performance-Tuning-10gR2-Second/dp/1555583458

    posted @ 2011-04-07 15:30 honzeland 閱讀(202) | 評論 (0)編輯 收藏

    GAE Logging

    Official document: http://code.google.com/appengine/docs/java/runtime.html#Logging  
    Log4j configuration in production env:
    http://blog.xam.de/2010/03/logging-in-google-appengine-for-java.html 
    http://www.mail-archive.com/google-appengine-java@googlegroups.com/msg06396.html

    posted @ 2010-11-11 12:52 honzeland 閱讀(269) | 評論 (0)編輯 收藏

    Read a Stress Test Report

    Load Average: 

    1. http://www.teamquest.com/resources/gunther/display/5/index.htm
    2. 
    http://blog.scoutapp.com/articles/2009/07/31/understanding-load-averages (Great)

    posted @ 2010-11-05 14:16 honzeland 閱讀(275) | 評論 (0)編輯 收藏

    GAE Mapping

    Executing Simple Joins Across Owned Relationships

    posted @ 2010-10-27 13:27 honzeland 閱讀(250) | 評論 (0)編輯 收藏

    Servlet Mappings - rules, pattern....

    http://www.rawbw.com/~davidm/tini/TiniHttpServer/docs/ServletMappings.html

    posted @ 2010-10-22 22:41 honzeland 閱讀(286) | 評論 (0)編輯 收藏

    GWT-RPC in a Nutshell - go through the internal

    GWT-RPC in a Nutshell: http://www.gdssecurity.com/l/b/2009/10/08/gwt-rpc-in-a-nutshell/

    posted @ 2010-10-22 22:40 honzeland 閱讀(223) | 評論 (0)編輯 收藏

    [zz] Tuning Your Stress Test Harness

    HTTP://WWW.THESERVERSIDE.COM/NEWS/1365219/TUNING-YOUR-STRESS-TEST-HARNESS?ASRC=SS_CLA_315053&PSRC=CLT_81

    posted @ 2010-09-11 12:27 honzeland 閱讀(243) | 評論 (0)編輯 收藏

    GWT 2 Spring 3 JPA 2 Hibernate 3.5 Tutorial – Eclipse and Maven 2 showcase

    See details at: http://www.javacodegeeks.com/2010/07/gwt-2-spring-3-jpa-2-hibernate-35.html
    Executing Simple Joins Across Owned Relationships for gae: http://gae-java-persistence.blogspot.com/2010/03/executing-simple-joins-across-owned.html

    posted @ 2010-08-20 13:01 honzeland 閱讀(417) | 評論 (0)編輯 收藏

    Java remote invocation frameworks (RPC)

    1. Remote Method Invocation (RMI)

    2. Hessian

    3. Burlap

    4. HTTP invoker

    5. EJB

    6. JAX-RPC

    7. JMX

    posted @ 2010-06-09 14:25 honzeland 閱讀(249) | 評論 (0)編輯 收藏

    Tomcat Architecture Diagram

    zz from http://marakana.com/forums/tomcat/general/106.html


    Valve and Filter:
    "Valve" is Tomcat specific notion, and they get applied at a higher level than anything in a specific webapp. Also, they work only in Tomcat.

    "Filter" is a Servlet Specification notion and should work in any compliant servlet container. They get applied at a lower level than all of Tomcat's
    Valves.

    However, consider also the division between your application and the application  server. Think whether the feature you're planning is part of your application, or is it rather a generic feature of the application server, which could have uses in other applications as well. This would be the correct criteria to decide between Valve and Filter.

    Order for filter: The order in which they are defined matters. The container will execute the filters in the order in which they are defined.

    posted @ 2010-05-10 10:39 honzeland 閱讀(1541) | 評論 (0)編輯 收藏

    Hibernate Annotations

    Use one single table "blank_fields" for both A and B. "blank_fields" has fields: 'ref_id', 'blank_field', 'type'. 'type' is used to identify which entity the record belongs to. Use 'type' + 'ref_id' to specify the collection of elements for one entity.

    @Entity
    @Table(name 
    = "table_a")
    public class A {
        
    private Set<BlankField> blankFields = new HashSet<BlankField>();
       
        @CollectionOfElements
        @Fetch(FetchMode.SUBSELECT)
        @Enumerated(EnumType.ORDINAL)
        @JoinTable(name 
    = "blank_fields", joinColumns = { @JoinColumn(name = "ref_id") })
        @Cascade(value 
    = org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
        @Column(name 
    = "blank_field", nullable = false)
        @SQLInsert(sql 
    = "INSERT INTO blank_fields(ref_id, blank_field, type) VALUES(?,?,0)")
        @Where(clause 
    = "type=0")
        
    public Set<BlankField> getBlankFields() { // BlankField is an enum
            
    return blankFields;
        }

        @SuppressWarnings(
    "unused")
        
    private void setBlankFields(Set<BlankField> blankFields) {
            
    this.blankFields = blankFields;
        }
    // End B

    @Entity
    @Table(name 
    = "table_b")
    public class B {
        
    private Set<BlankField> blankFields = new HashSet<BlankField>();
       
        @CollectionOfElements
        @Fetch(FetchMode.SUBSELECT)
        @Enumerated(EnumType.ORDINAL)
        @JoinTable(name 
    = "blank_fields", joinColumns = { @JoinColumn(name = "ref_id") })
        @Cascade(value 
    = org.hibernate.annotations.CascadeType.DELETE_ORPHAN)
        @Column(name 
    = "blank_field", nullable = false)
        @SQLInsert(sql 
    = "INSERT INTO blank_fields(ref_id, blank_field, type) VALUES(?,?,1)"// used for insert
        @Where(clause = "type=1"// used for query, if not @CollectionOfElements, such as @OneToMany, use @WhereJoinTable instead
        public Set<BlankField> getBlankFields() {
            
    return blankFields;
        }

        @SuppressWarnings(
    "unused")
        
    private void setBlankFields(Set<BlankField> blankFields) {
            
    this.blankFields = blankFields;
        }
    }

    當(dāng)然還有其他的方式來實現(xiàn)上面的需求,上面采用的單表來記錄不同實體的associations(這兒是CollectionOfElements,并且返回的是Set<Enum>,不是Set<Embeddable>),然后用'type'來區(qū)分不同的實體,這樣做的好處是:數(shù)據(jù)庫冗余少,易于擴(kuò)展,對于新的實體,只需加一個type值,而不需更改數(shù)據(jù)庫表結(jié)構(gòu)。另外一種采用單表的方式是為每個實體增加新的字段,如
    "blank_fields": 'a_id', 'b_id', 'blank_field', a_id reference table_a (id), b_id reference table_b (id). 這樣在映射的時候更簡單,
    對于A,映射為
    @JoinTable(name = "blank_fields", joinColumns = { @JoinColumn(name = "a_id") })
    對于B,映射為
    @JoinTable(name = "blank_fields", joinColumns = { @JoinColumn(name = "b_id") })
    這樣作的缺點是:帶來了數(shù)據(jù)庫冗余,對于blank_fields來講,任一條記錄,a_id和b_id中只有一個不為null。當(dāng)多個實體共用這個表時,用上面的方法更合理,如果共用實體不多時,這種方法更方便。

    posted @ 2010-04-20 17:20 honzeland 閱讀(454) | 評論 (0)編輯 收藏

    One Hibernate Session Multiple Transactions

    The case to use One Hibernate Session Multiple Transactions:
    each transaction would NOT affect others.
    i.e., open multiple transactions on the same session, even though one transaction rolls back, other transactions can be committed. If one action fails, others should fail too, then we should use one transaction for all actions.

    Note:
    A rollback with a single Session will lead to that Session being cleared (through "Session.clear()").
    So do lazy collections still work if the session is cleared? =>Not of any objects that you loaded up until the rollback. Only for new objects loaded afterwards.
    We should load necessary objects to session for each transactional action to avoid LazyInitializationException, even if those objects are loaded before other forward transactional actions, since forward action may be rolled back and clear the session.

    BTW, Hibernate Session.merge() is different with Session.update() by:
    Item item2 = session.merge(item);
    item2 
    == item; // false, item - DETACHED, item2 - PERSIST
    session.update(item); // no return value, make item PERSIST


    posted @ 2010-03-01 11:47 honzeland 閱讀(409) | 評論 (0)編輯 收藏

    主站蜘蛛池模板: 久久久久亚洲国产AV麻豆| 人人狠狠综合久久亚洲88| 亚洲成aⅴ人片在线影院八| 国产白丝无码免费视频| 亚洲av无码国产精品色午夜字幕 | 亚洲av日韩av永久在线观看| 成人无码区免费视频观看| 亚洲AV无码专区在线亚 | 久久WWW免费人成人片| 77777亚洲午夜久久多喷| 日韩免费a级毛片无码a∨| 亚洲人成色在线观看| 亚洲av手机在线观看| 国产免费区在线观看十分钟| 亚洲国产成人精品无码区在线观看| 久久青草91免费观看| 亚洲伊人久久大香线蕉在观| 成年人网站在线免费观看| 国产91成人精品亚洲精品| 亚洲毛片av日韩av无码| 在线观看免费播放av片| 亚洲国产精品综合久久久| 全免费a级毛片免费看无码| 在线播放国产不卡免费视频| 国产亚洲精品国产| 成人免费大片免费观看网站| 亚洲乱码日产精品一二三| 久久久久无码专区亚洲av| 久久午夜夜伦鲁鲁片免费无码 | 亚洲AV日韩精品一区二区三区| 两个人看的www高清免费视频| 久久久无码精品亚洲日韩京东传媒 | 亚洲精品免费在线视频| 精品国产免费观看久久久| 久久久精品视频免费观看| 亚洲精品人成电影网| 免费A级毛片在线播放不收费| 国产猛男猛女超爽免费视频| 中文字幕亚洲情99在线| 国产亚洲精品福利在线无卡一| 最近2019免费中文字幕6|