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

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

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

    不做浮躁的人
    正在行走的人...
    posts - 171,  comments - 51,  trackbacks - 0

    GPS通過2個概念提供了整合不同的可索引的數據源:CompassGps和CompassGpsDevice。Device可以結合任何類型的可索引數據來源,它提供索引數據、搜索數據、敏感數據變化的能力。?GPS建立在Compass基礎之上。利用Compass的特征,如:事務、OSEM以及API等。

    CompassGps是GPS的主要接口,它擁有一系列的CompassGpsDevices,并且管理他們的生命周期。

    Compass提供了兩個Gps的實現:
    SingleCompassGps:擁有一個compass實例。這個compass實例用來做索引和鏡像操作。
    DualCompassGps:擁有兩個Compass實例。indexCompass和mirrorCompass。主要處理兩個事務級別。indexCompass一般采用batch_insert隔離級別,而mirrorCompass采用read_committed事務級別。

    hibernate Gps Device

    hb3新的基于時間的機制提供了實時數據改變的鏡像。數據的傳送順序為:Database -- Hibernate -- Objects -- Compass::Gps --Compass::Core (Search Engine).
    在hb3中,程序配置:
    Compass compass = ... // set compass instance
    CompassGps gps = new SingleCompassGps(compass);
    CompassGpsDevice hibernateDevice =
    new Hibernate3GpsDevice("hibernate", sessionFactory);
    gps.addDevice(hibernateDevice);
    .... // configure other devices
    gps.start();

    hibernate device提供了一個fetchCount參數,這個參數控制索引一個類的分頁進程。

    實時數據鏡像:在hb3中是基于新的時間機制。數據改變將會反射給compass index。配置時要注意的是系統和compass必須使用相同的SessionFactory。如果使用hb3和spring,請使用SpringHibernate3GpsDevice。

    Compass與spring結合:
    1:支持compass級別的工廠bean。采用Spring ioc的配置選項。
    2:提供Compass DAO級別的支持。采用事務整合和DAO支持類。
    3:擴展GPS Hiberante3 device。
    4:提供OJB的整合支持。
    5:提供Spring MVC的搜索控制器和索引控制器。

    spring中配置compass bean:
    <bean id="compass"
    class="org.compass.spring.LocalCompassBean">
    <property name="resourceLocations">
    <list>
    <value>classpath:org/compass/spring/test/A.cpm.xml</value>
    </list>
    </property>
    <property name="compassSettings">
    <props>
    <prop key="compass.engine.connection">
    target/testindex
    </prop>
    <!-- This is the default transaction handling
    (just explicitly setting it) -->
    <prop key="compass.transaction.factory">
    org.compass.core.transaction.LocalTransactionFactory
    </prop>
    </props>
    </property>
    </bean>

    compass提供CompassDaoSupport類來執行Dao操作。

    public class LibraryCompassDao extends CompassDaoSupport {
    public int getNumberOfHits(final String query) {
    Integer numberOfHits = (Integer)getCompassTemplate().execute(
    new CompassCallback() {
    public Object doInCompass(CompassSession session) {
    CompassHits hits = session.find(query);
    return new Integer(hits.getLength());
    }
    }
    );
    }
    return numberOfHits.intValue();
    }

    然后配置該DAO類使用的Compass實例:
    <beans>
    <bean id="libraryCompass" class="LibraryCompassDao">
    <property name="compass">
    <ref local="compass" />
    </property>
    </bean>
    </beans>

    SpringSyncTransaction:compass將同步spring本身的事務.
    SpringHibernate3GpsDevice:對Hibernate3GpsDevice的擴展,能夠處理spring帶來的sessionFactory以便使用時間機制監聽實時數據改變。

    posted on 2006-12-02 15:46 不做浮躁的人 閱讀(3307) 評論(1)  編輯  收藏

    FeedBack:
    # re: compass學習筆記4
    2008-11-20 10:15 | 老丁
    遇到 clob和blob 會報錯怎么解決啊?

    Exception in thread "main" org.compass.core.mapping.MappingException: No converter defined for type [java.sql.Clob]

      回復  更多評論
      

    只有注冊用戶登錄后才能發表評論。


    網站導航:
     

    <2006年12月>
    262728293012
    3456789
    10111213141516
    17181920212223
    24252627282930
    31123456

    常用鏈接

    留言簿(9)

    隨筆分類(31)

    隨筆檔案(75)

    文章分類(1)

    文章檔案(3)

    搜索

    •  

    最新評論

    閱讀排行榜

    評論排行榜

    主站蜘蛛池模板: 国产卡一卡二卡三免费入口| 67pao强力打造高清免费| 免费观看午夜在线欧差毛片| 亚洲色最新高清av网站| 成人免费在线视频| 亚洲AV电影天堂男人的天堂| 青青青国产免费一夜七次郎| 日韩欧美亚洲中文乱码| 亚洲乱码国产一区网址| 好湿好大好紧好爽免费视频| 亚洲AV永久无码精品一百度影院| 免费污视频在线观看| 亚洲永久中文字幕在线| 天天看免费高清影视| 成人亚洲国产精品久久| 国产AV无码专区亚洲AWWW| 99久久免费国产特黄| 亚洲视频欧洲视频| 卡一卡二卡三在线入口免费| 国产亚洲美女精品久久| 亚洲中文字幕日产乱码高清app| 你懂的免费在线观看网站| 亚洲中字慕日产2021| 国产精品免费电影| 在线成人精品国产区免费| 久久久久亚洲AV无码永不| 成人看的午夜免费毛片| 一级毛片试看60分钟免费播放| 亚洲AV第一页国产精品| 暖暖在线日本免费中文| 二区久久国产乱子伦免费精品| 亚洲狠狠ady亚洲精品大秀| 国产精品极品美女免费观看| 国产三级在线免费| 亚洲中文字幕AV每天更新| 亚洲精品在线视频| 国产h视频在线观看免费| 一级毛片免费播放试看60分钟| 亚洲电影免费观看| 久久久无码精品亚洲日韩软件| 69天堂人成无码麻豆免费视频|