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

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

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

    Oracle神諭

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      284 隨筆 :: 9 文章 :: 106 評(píng)論 :: 0 Trackbacks

    #

    What is Quartz? (什么是Quartz?)
    Quartz is a full-featured, open source job scheduling system that can be integrated with, or used along side virtually any J2EE or J2SE application - from the smallest stand-alone application to the largest e-commerce system. Quartz can be used to create simple or complex schedules for executing tens, hundreds, or even tens-of-thousands of jobs; jobs whose tasks are defined as standard Java components or EJBs. The Quartz Scheduler includes many enterprise-class features, such as JTA transactions and clustering.

    Quartz 是一個(gè)功能齊全的、開源的job時(shí)間調(diào)度系統(tǒng),它可以被結(jié)合的,或者伴隨虛擬的任何J2EE或J2SE程序-從最小的獨(dú)立的應(yīng)用程序到最大的e-commerce系統(tǒng)被使用。Quartz可以用來創(chuàng)建簡(jiǎn)單或復(fù)雜的時(shí)間調(diào)度來執(zhí)行十、百、千、甚至上萬的jobs;獲得的job被定義為一個(gè)標(biāo)準(zhǔn)的java組件或EJBs. 這個(gè)Quartz 時(shí)間調(diào)度包含很多企業(yè)類的特征,例如JTA事務(wù)和簇。

    The licensing of Quartz versions 1.0 through 1.4.5 is similar to both the BSD and ASF (Apache) public licenses, which means it's free for use, even within commercial products.

    Quartz 1.0版本到1.4.5版本的licensing 是類似與BSD和ASF(apache)公共licenses, 它意味著可以免費(fèi)使用,甚至使用在商業(yè)產(chǎn)品中使用。
    With the upcoming release of version 1.5.0, Quartz is moving to the Apache 2.0 license.
    伴隨1.5.0版本的發(fā)布,Quartz將轉(zhuǎn)移向apache 2.0 的license.

    What can Quartz do for you? (Quartz可以為你做什么?)
    If your application has tasks that need to occur at given moments in time, or if your system has recurring maintenance jobs then Quartz may be your ideal solution.

    如果你的程序有一些這樣的任務(wù),它需要及時(shí)地發(fā)生在給定時(shí)間,或者你如果你的系統(tǒng)有連續(xù)維護(hù)jobs,那么Quartz可以成為你的理想的解決方案。

    Sample uses of job scheduling with Quartz:
    Quartz使用job時(shí)間調(diào)度的范例

    Driving Workflow: As a new order is initially placed, schedule a Job to fire in exactly 2 hours, that will check the status of that order, and trigger a warning notification if an order confirmation message has not yet been received for the order, as well as changing the order's status to 'awaiting intervention'.
    System Maintenance: Schedule a job to dump the contents of a database into an XML file every business day (all weekdays except holidays) at 11:30 PM.

    工作流驅(qū)動(dòng):作為一個(gè)新的訂單被初始化放置,調(diào)度一個(gè)job去工作在正好兩個(gè)小時(shí)內(nèi),它將檢查訂單的狀態(tài),并且觸發(fā)一個(gè)警告通知如果訂單確認(rèn)信息沒有被接收,又改變訂單的狀態(tài)到"等待干涉"。
    系統(tǒng)維護(hù):調(diào)度一個(gè)job來將數(shù)據(jù)庫轉(zhuǎn)化為XML文件 每商業(yè)日期(所有周末除了節(jié)假日)在下午11:30。

     

    posted @ 2005-07-20 12:05 java世界暢談 閱讀(820) | 評(píng)論 (1)編輯 收藏

    供應(yīng)鏈已被當(dāng)成企業(yè)成功的關(guān)鍵要素,實(shí)施供應(yīng)鏈管理的企業(yè)與戰(zhàn)略性供應(yīng)商分享設(shè)計(jì)及需求信息,已將觸角延伸至企業(yè)之外。供應(yīng)鏈管理就是利用線形規(guī)劃等核心優(yōu)化技術(shù),對(duì)從供應(yīng)商的供應(yīng)商、供應(yīng)商、企業(yè)、客戶到客戶的客戶的整個(gè)鏈條的管理和優(yōu)化。
    ......
    供應(yīng)鏈管理重在兩個(gè)部門:供應(yīng)鏈的計(jì)劃和執(zhí)行。計(jì)劃包括倉儲(chǔ)計(jì)劃、預(yù)測(cè)需求計(jì)劃、物流的配置計(jì)劃、生產(chǎn)計(jì)劃、銷售計(jì)劃等;供應(yīng)鏈的執(zhí)行是以訂單的執(zhí)行和物流的執(zhí)行來支撐的。
    ......
    ....協(xié)同是提高供應(yīng)鏈可視性的手段,計(jì)劃是供應(yīng)鏈管理的核心。
    .......
    企業(yè)對(duì)計(jì)劃的重視程度不夠,只重視執(zhí)行而不重視計(jì)劃,往往是導(dǎo)致供應(yīng)鏈管理系統(tǒng)應(yīng)用不理想的重要原因。...而自身又不在預(yù)測(cè)和計(jì)劃上下功夫。......計(jì)劃恰恰是企業(yè)以及供應(yīng)鏈運(yùn)作的根本。
     做到有效的供應(yīng)鏈管理需要企業(yè)有效地做到以下三點(diǎn):1.觀念的轉(zhuǎn)變和理念上重視,企業(yè)必須對(duì)供應(yīng)鏈有足夠的重視,把供應(yīng)鏈的效率作為企業(yè)的核心競(jìng)爭(zhēng)力之一來抓。2.實(shí)施供應(yīng)鏈管理是企業(yè)持續(xù)改進(jìn)、持續(xù)優(yōu)化的進(jìn)程,而不是項(xiàng)目上線任務(wù)就能結(jié)束,企業(yè)要有持續(xù)的動(dòng)力。3.要有持續(xù)的投資、有專門的隊(duì)伍,從組織上、人員上給予保障,并且企業(yè)要把這些投資看作是提高核心競(jìng)爭(zhēng)力的必要條件,而不是負(fù)擔(dān)。這是成功的供應(yīng)鏈管理基礎(chǔ)。
    ......
    記者:i2的供應(yīng)鏈管理系統(tǒng)包含哪些功能模塊?

      傅淼:i2供應(yīng)鏈管理系統(tǒng)的主要功能包括:訂單履行(協(xié)同補(bǔ)貨、客戶訂單履行、供應(yīng)鏈可視性)、供應(yīng)商尋源與采購(協(xié)同供應(yīng)執(zhí)行、危險(xiǎn)物料管理、產(chǎn)品尋源與重復(fù)使用、尋源執(zhí)行、供應(yīng)商戰(zhàn)略及績(jī)效管理)、供應(yīng)與需求計(jì)劃(協(xié)同供應(yīng)執(zhí)行、需求管理、工廠解決方案、庫存優(yōu)化、銷售與運(yùn)作管理、供應(yīng)鏈可視性、供應(yīng)管理)、運(yùn)輸與配送(補(bǔ)貨計(jì)劃、戰(zhàn)略網(wǎng)絡(luò)設(shè)計(jì)與分析、供應(yīng)商可視性、運(yùn)輸投標(biāo)協(xié)同、運(yùn)輸建模與分析、運(yùn)輸計(jì)劃與管理)、內(nèi)容與數(shù)據(jù)服務(wù)、供應(yīng)鏈運(yùn)作服務(wù)平臺(tái)(業(yè)務(wù)流程執(zhí)行、統(tǒng)一基礎(chǔ)設(shè)施服務(wù)、主數(shù)據(jù)管理、績(jī)效管理)。


    摘選于http://www.topoint.com.cn/zyzx/view.asp?id=5613&cc=0

    posted @ 2005-07-18 09:48 java世界暢談 閱讀(482) | 評(píng)論 (0)編輯 收藏

    Using the ProxyFactoryBean to create AOP proxies
    If you're using the Spring Ioc container (an applicationContext or BeanFactory) for you business object--and you should be!-- you will want to use one of Spring's AOP fatoryBeans.(Remeber that a factory bean introduces a layer of indirection, enabling it to create objects of different type).

    The basic way to create an AOP proxy in Spring to use the org.springframework.aop.framework.ProxyFactoryBean. This gives complete control over the pointcuts an advice that will apply, and theire ordering . However ,there are simpler options that are preferable(更可取的、更好的) if you don't need such control.

    Basics
    The proxyFactoryBean,like other Spring FactoryBean implementations,introduces a level of indirection(間接). If you define a ProxyFactoryBean with name foo,what objects referencing foo see is not the ProxyFactoryBean instance itself, but an object created by the ProxyFactoryBeans's implementation of the getObject() method. This method will create an AOP proxy wrapping a target object.

    One of the most important benefits of using a ProxyFactoryBean or other IoC-aware to create AOP proxies, it that it means that advices and pointcuts can also be managed by IoC. This is a powerful feature , enabling certain approaches that are hard to achieve with other AOP frameworks. For example,an advice may itself reference application objects(besides the target , which should be available in any AOP framework),benefiting from all the pluggability provided by Dependency Injection.

    JavaBean properties
    Like most FactoryBean implementations provided with Spring, ProxyfactoryBean is itself a JavaBean. It properties are used to:
    Specify the target you  want to proxy
    Specify whether to use CGLIB

    Some key properties are inherited from org.springframework.aop.framework.ProxyConfig: the subclass for all AOP proxy factories. These include:
    proxyTargetClass: true if we should proxy the target class,rather than its interfaces. If this  is true we need to use CGLIB.

    optimize: whether to apply aggressive optimization to created proxies. Don't use this setting unless you  understand how the relevant(相關(guān)的) AOP proxy handles optimization. This is currently used only for CGLIB proxies;it has no effect with  JDK dynamic proxies(the default).

    frozen:whether avice changes should be disallowed once the proxy factory has bean configured. Default is false.

    exposeProxy: whether the current proxy should be exposed in a ThreadLocal so that it can be accessed by the target (It's available via the MethodInvocation without the need for a ThreadLocal) If a target needs to obtain the proxy and exposedProxy is true, the target can use the AopContext.currentProxy() method.

    aopProxyFactory: the implementation of AopProxyFactory to use. Offers a way of customizing whether to use dynammic proxies,CGLIB or any other proxy strategy. The default implementation will choose dynamic proxies or CGLIB appropriately. There should be need to use this property, it's intended to allow the addition of new proxy types in spring 1.1.

    Other properties specific to ProxyFactoryBean include:
    .proxyInterfaces: array of String interface names.  If this isn't supplied, a CGLIB proxy for the target class will be used.
    .interceptorNames:String array of Advisor,interceptor or other advice names to apply.Ordering is sugnicicant. first come,first serve that is. The first interceptor in the list will be the first to be able to interceptor the invocation (of course if it concerns a regular MethodInterceptor or BeforeAdvice. The names are bean names in the current factory , including  bean names from ancestor factories. You  can't mention bean references here since doing so would result iin the ProxyFactoryBean ignoring the singleton  setting of the advise. you can append an iinterceptor name with an asterisk(*).  This will result  in the application of all advisor beans withe names starting with the part before the asterisk to be applied.  An example of using this feature can be found below.

    Singleton: whether or not the factory should return a single object, no matter how often the getObject() method is called. Server FactoryBean implementations offer such a method. Default value is true. If you want to use stateful advice --for example ,for stateful mixins-user prototype advices along withe s singleton value of false.

    Proxying interfaces

    <bean id="personTarget" class="com.mycompany.PersionImpl">
       <property name="name"><value>Tony</value></property>
       <property name="age"><value>51</value></property>  
    </bean>

    <bean id="myAdvisor" class="com.mycompany.MyAdvisor">
       <property name="someProperty"><value>Custom string property value</value></property>
    </bean>

    <bean id="debugInterceptor" class="org.springframework.aop.interceptor.DebugInteceptor" ></bean>

    <bean id="person" class="org.springframework.aop.framework.ProxyFactoryBean">
       <property name="proxyInterface"><value>com.company.Person</value></property>
      
       <property name="target"><ref local="personTarget"/></property>
       <property name="interceptorNames">
          <list>
             <value>myAdvisor</value>
             <value>debugInterceptor</value>
          </list>
       </property>
    </bean>

     

    posted @ 2005-07-07 10:43 java世界暢談 閱讀(478) | 評(píng)論 (0)編輯 收藏

           “首先,系統(tǒng)需要骨架,也就是商業(yè)模型的設(shè)計(jì),沒有這種框架,便會(huì)淪為打補(bǔ)丁,久而久之,便縫成了一件丐幫長(zhǎng)老的百衲衣?!?BR>  “其二,要有既懂速遞業(yè)務(wù),又懂信息化的復(fù)合型人才,否則,便會(huì)形成外行指揮內(nèi)行的合作格局,讓不懂IT的速遞從業(yè)人員告訴IT人員怎么開發(fā)系統(tǒng),開發(fā)什么樣的系統(tǒng),失敗便是情理之中了?!?BR>  “其三,要能整理需求,更要能提升需求,信息化絕對(duì)不是手工操作的簡(jiǎn)單復(fù)制,要牽扯到流程重組,財(cái)務(wù)模型設(shè)計(jì),人力資源,規(guī)范化等各個(gè)環(huán)節(jié),一句話,要有顧問能力。”
      “其四,適度超前,滿足未來需求而不是眼前需求,這樣才不會(huì)被正常的需求變動(dòng)遷著鼻子走。”
      “其五。。。。。。”
      “其實(shí),最重要的,怎樣定位您的IT系統(tǒng),”我強(qiáng)調(diào)說,“有人把它當(dāng)成工具,有人把它作為擺設(shè),有人把它作為核心競(jìng)爭(zhēng)力。。。。。。”
      “核心競(jìng)爭(zhēng)力?”林夕滿臉狐疑。
      “對(duì),核心競(jìng)爭(zhēng)力,有人會(huì)根據(jù)軟件提供的功能流程重新改組組織結(jié)構(gòu),例如,速遞軟件有一個(gè)功能叫主動(dòng)監(jiān)控平臺(tái),有家公司據(jù)此專門成立了一個(gè)監(jiān)察部,對(duì)問題件進(jìn)行監(jiān)控預(yù)警;還譬如,軟件提供了一個(gè)個(gè)性化服務(wù)平臺(tái),有公司利用這個(gè)功能,裁掉了客服部三分之二的人員,服務(wù)流程也作了調(diào)整,服務(wù)質(zhì)量反而大幅提升了?!?BR>
    原文地址:http://www.szmsd.com/20041029.htm
    posted @ 2005-07-06 10:13 java世界暢談 閱讀(151) | 評(píng)論 (0)編輯 收藏

     MS SQL有許多默認(rèn)值是可以修改的,比如:MS SQL默認(rèn)的用戶連接數(shù)是15,一旦使用某數(shù)據(jù)庫服務(wù)器的人多了的時(shí)候,特別是一些用戶喜歡打開多個(gè)連接的時(shí)候,經(jīng)常造成超過連接數(shù)而使一些人連接不上。
    sp_configure語法:sp_configure [_name[,_value]]
    

    ---- 在MS SQL中,以"user connection"標(biāo)記用戶數(shù)目,所以作如下修改:

    ---- 1、以管理員帳號(hào)登錄進(jìn)MS SQL數(shù)據(jù)庫服務(wù)器;

    ---- 2、運(yùn)行sp_configure系統(tǒng)存儲(chǔ)過程:在Isq_w或Enterprise Manager中的SQL Query Tool中敲入:

    sp_configure "user connections", 150
    go          --如果愿意選比150更大的數(shù)字當(dāng)然可以。
        --最大只能是32767
    RECONFIGURE
    Go
    
    3、執(zhí)行敲入的SQL語句; 
    4、關(guān)閉SQL服務(wù),(在EnterPrise Manger中選中服務(wù)器,點(diǎn)右鼠標(biāo)鍵,選stop,再選start.大功告成! 
    為什么要執(zhí)行第四步?Sp_configure所帶的參數(shù)分兩類,動(dòng)態(tài)與靜態(tài),動(dòng)態(tài)參數(shù)不需要重新啟動(dòng)服務(wù)器,運(yùn)行sp_configure和recnfigure后就改變了,而靜態(tài)參數(shù)要重新啟動(dòng)后才能改變。上面的"user connections"就是靜態(tài)參數(shù)。 
    			
    posted @ 2005-07-01 13:52 java世界暢談 閱讀(935) | 評(píng)論 (0)編輯 收藏

    我們使用jtds的SQL Server的驅(qū)動(dòng)替代原來的SQL Server的驅(qū)動(dòng)。后來出現(xiàn)在log中輸出了這樣的信息:
    2005-06-30 09:42:10 [org.hibernate.util.JDBCExceptionReporter] [http-8080-Processor24] [WARN] - SQL Warning: 5701, SQLState: 01000
    2005-06-30 09:42:10 [org.hibernate.util.JDBCExceptionReporter] [http-8080-Processor24] [WARN] - 已將數(shù)據(jù)庫上下文改為 'logistics'。
    2005-06-30 09:42:10 [org.hibernate.util.JDBCExceptionReporter] [http-8080-Processor24] [WARN] - SQL Warning: 5703, SQLState: 01000
    2005-06-30 09:42:10 [org.hibernate.util.JDBCExceptionReporter] [http-8080-Processor24] [WARN] - 已將語言設(shè)置改為 簡(jiǎn)體中文。
    經(jīng)過使用Debug級(jí)別的log輸出,發(fā)現(xiàn)是在
    SQLDiagnostic.java
     /**
         * Create a dianostic SQLException or SQLWarning.
         *
         * @param number SQL Server error number.
         * @param state SQL Server state code.
         * @param serverity SQL Server serverity > 10 = error.
         * @param message SQL Server error message text.
         * @param server SQL Server name.
         * @param procName SQL Server stored procedure name.
         * @param line SQL Server error line number in SQL source.
         */
        void addDiagnostic(int number,
                           int state,
                           int serverity,
                           String message,
                           String server,
                           String procName,
                           int line)
    這里捕獲了 SQL Server error number的,
    后經(jīng)過MSDN找到如下資料:
    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/trblsql/tr_reslsyserr_2_9dtd.asp

    Error 5701

    Severity Level 10
    Message Text

    Changed database context to '%.*ls'.

    Explanation

    This is an informational message indicating that the database context has changed. This message is returned anytime a USE database statement is executed.

    Action

    None needed.

    http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbcsql/od_6_010_34oj.asp

    5701

    Indicates that SQL Server put the user's context into the default database defined in the data source, or into the default database defined for the login ID used in the connection if the data source did not have a default database.

    5703

    Indicates the language being used on the server.

    posted @ 2005-06-30 10:06 java世界暢談 閱讀(974) | 評(píng)論 (1)編輯 收藏

    13.7. JasperReports
    JasperReports (http://jasperreports.sourceforge.net) is a powerful, open-source reporting engine that supports the creation of report designs using an easily understood XML file formats. JasperReports is capable of rendering reports output into four different formats: CSV, Excel, HTML and PDF.

    13.7.1. Dependencies (依賴)
    Your application will need to include the latest release of JasperReports, which at the time of writing was 0.6.1. JasperReports itself depends on the following projects:

    BeanShell

    Commons BeanUtils

    Commons Collections

    Commons Digester

    Commons Logging

    iText

    POI

    JasperReports also requires a JAXP compliant(適應(yīng)的) XML parser.

    13.7.2. Configuration(配置)
    To configure JasperReports views in your ApplicationContext you have to define a ViewResolver to map view names to the appropriate view class depending on which format you want your report rendered in.

    13.7.2.1. Configuring the ViewResolver
    Typically, you will use the ResourceBundleViewResolver to map view names to view classes and files in a properties file

    <bean id="viewResolver" class="org.springframework.web.servlet.view.ResourceBundleViewResolver">
        <property name="basename">
            <value>views</value>
        </property>
    </bean>
                     
    Here we've configured an instance of ResourceBundleViewResolver which will look for view mappings in the resource bundle with base name views. The exact contents of this file is described in the next section.

    13.7.2.2. Configuring the Views
    Spring contains five different View implementations for JasperReports four of which corresponds to one of the four output formats supported by JasperReports and one that allows for the format to be determined at runtime:

    JasperReport View Class
    1.JasperReportsView           CSV
    2.JasperReportsHtmlView       HTML
    3.JasperReportsPdfView        PDF
    4.JasperReportsXlsView        EXCEL
    5.JasperReportsMutiFormatView

    Mapping one of these classes to a view name and a report file is simply a matter of adding the appropriate entries into the resource bundle configured in the previous section as shown here:

    simpleReport.class=org.springframework.web.servlet.view.jasperreports.JasperReportsPdfView
    simpleReport.url=/WEB-INF/reports/DataSourceReport.jasper
                 
    Here you can see that the view with name, simpleReport, is mapped to the JasperReportsPdfView class. This will cause the output of this report to be rendered in PDF format. The url property of the view is set to the location of the underlying report file.


    13.7.2.3. About Report Files
    JasperReports has two distinct types of report file: the design file, which has a .jrxml extension, and the compiled report file, which has a .jasper extension. Typically, you use the JasperReports Ant task to compile your .jrxml design file into a .jasper file before deploying it into your application. With Spring you can map either of these files to your report file and Spring will take care of compiling the .jrxml file on the fly for you. You should note that after a .jrxml file is compiled by Spring, the compiled report is cached for the life of the application. To make changes to the file you will need to restart your application.

    JasperReports擁有兩種不同的類型的報(bào)表文件:設(shè)計(jì)文件,它是一個(gè)擁有.jrxml 擴(kuò)展的文件,和編譯好的報(bào)表文件。一般,你使用ant任務(wù)在你部署到你的程序中之前來編譯你的.jrxml設(shè)計(jì)報(bào)表文件。使用Spring 你可以影射這些文件中的任一到你的報(bào)表文件,Spring將會(huì)為你在空閑時(shí)照顧編譯.jrxml文件。 你應(yīng)當(dāng)注意在一個(gè).jrxml文件被編譯之后,這個(gè)編譯的報(bào)表是被緩存的在你的application生命周期中。如果這些文件修改了,你需要重新啟動(dòng)的你的程序。

    13.7.2.4. Using JasperReportsMultiFormatView  使用JasperReportsMutiFormatView
    The JasperReportsMultiFormatView allows for report format to be specified at runtime. The actual rendering of the report is delegated to one of the other JasperReports view classes - the JasperReportsMultiFormatView class simply adds a wrapper layer that allows for the exact implementation to be specified at runtime.

    JasperReportsMutilFormatView允許你在運(yùn)行時(shí)期指定報(bào)表的格式。報(bào)表的實(shí)際的表現(xiàn)是為委托到JasperReports 視圖類的中的一個(gè)--JasperMutilFormatView類簡(jiǎn)單的加了一個(gè)包裝層允許在運(yùn)行時(shí)期正確的實(shí)現(xiàn)被指定。

    The JasperReportsMultiFormatView class introduces two concepts: the format key and the discriminator key. The JasperReportsMultiFormatView class uses the mapping key to lookup the actual view implementation class and uses the format key to lookup up the mapping key. From a coding perspective you add an entry to your model with the formay key as the key and the mapping key as the value, for example:

     

    public ModelAndView handleSimpleReportMulti(HttpServletRequest request,
    HttpServletResponse response) throws Exception {

      String uri = request.getRequestURI();
      String format = uri.substring(uri.lastIndexOf(".") + 1);

      Map model = getModel();
      model.put("format", format);

      return new ModelAndView("simpleReportMulti", model);
    }
    In this example, the mapping key is determined from the extension of the request URI and is added to the model under the default format key: format. If you wish to use a different format key then you can configure this using the formatKey property of the JasperReportsMultiFormatView class.

    By default the following mapping key mappings are configured in JasperReportsMultiFormatView:
    Table 13.3. JasperReportsMultiFormatView Default Mapping Key Mappings

    Mapping Key View Class
    csv   JasperReportsCsvView
    html  JasperReportsHtmlView
    pdf   JasperReportsPdfView
    xls   JasperReportsXlsView

    So in the example above a request to URI /foo/myReport.pdf would be mapped to the JasperReportsPdfView class. You can override the mapping key to view class mappings using the formatMappings property of JasperReportsMultiFormatView.

    posted @ 2005-06-29 10:24 java世界暢談 閱讀(3469) | 評(píng)論 (0)編輯 收藏

    SQL Profiler Introduction

    This is a quickly hacked tool to do statistics(統(tǒng)計(jì)) on SELECT queries in order to know where it is most efficient to create indexes.  目的是最有效的創(chuàng)建索引.

    This small tool, released under an Apache-based license connects to the P6Spy JDBC logger and displays in real time the queries going to the database. It uses an integrated SQL parser to build statistics on the most accessed tables and columns and can generate SQL index creation files. Other information is also gathered and displayed, such as the request time for a single request, for a class of request, and for all the requests. Sorting may be done on these views to detect(察覺) database problems efficiently.


    This tool can be very useful when you have a big volume of queries that you need to analyze not one by one一個(gè)接一個(gè) (meaning that the specific time isn't that much of interest), but rather(若非) when you want to know what "group" of queries is taking a lot of time, such as queries on the same tables and columns but with different query values. The integrated SQL parser (built with ANTLR) is used to analyze the incoming SELECT queries.

    The Swing GUI was based on Apache's Log4J Chainsaw, but all the bugs are mine. Also contributors are welcome to test, make new suggestions, give their opinion and submit patches.

    posted @ 2005-06-28 14:57 java世界暢談 閱讀(386) | 評(píng)論 (1)編輯 收藏

    Considerations when choosing a technology (當(dāng)選擇一個(gè)技術(shù)時(shí)候的考慮)
    Each and every technology presented here has its drawbacks. You should carefully consider you needs, the services your exposing and the objects you'll be sending over the wire when choosing a technology.
    每個(gè)技術(shù)這里介紹的都有它的缺點(diǎn)。你應(yīng)該仔細(xì)考慮你的需要,當(dāng)你選擇的時(shí)考慮你的暴露的服務(wù)和你將要發(fā)送關(guān)系的對(duì)象。


    When using RMI, it's not possible to access the objects through the HTTP protocol, unless you're tunneling the RMI traffic. RMI is a fairly heavy-weight protocol in that it support full-object serialization which is important when using a complex data model that needs serialization over the wire. However, RMI-JRMP is tied to Java clients: It is a Java-to-Java remoting solution.
    當(dāng)我們使用RMI,我們不可以通過http協(xié)議訪問對(duì)象,除非你打通RMI交通的隧道。RMI 是一個(gè)非常重量級(jí)協(xié)議,在其中他支持的所有對(duì)象的序列化是非常重要的,當(dāng)使用一個(gè)需要序列化關(guān)聯(lián)的復(fù)雜的數(shù)據(jù)模型。然而,RMI-JRMP 是依賴java客戶端的:它是java-to-java的遠(yuǎn)程解決方案。


    Spring's HTTP invoker is a good choice if you need HTTP-based remoting but also rely on Java serialization. It shares the basic infrastructure with RMI invokers, just using HTTP as transport. Note that HTTP invokers are not only limited to Java-to-Java remoting but also to Spring on both the client and server side. (The latter also applies to Spring's RMI invoker for non-RMI interfaces.)
    Spring 的HTTP invoker 是一個(gè)不錯(cuò)的選擇,如果你需要基于HTTP的遠(yuǎn)程,而且需要java序列化回復(fù)。它使用RMI invoker分享了基礎(chǔ)結(jié)構(gòu),僅僅使用HTTP作為傳輸。注意HTTP invoker不是僅僅限制給java-to-java的遠(yuǎn)程而且是在客戶端和服務(wù)器端的Spring.(后面的也應(yīng)用到Spring 的RMI invoker為非RMI的接口)。

    Hessian and/or Burlap might provide significant value when operating in a heterogeneous environment, because they explicitly allow for non-Java clients. However, non-Java support is still limited. Known problems include the serialization of Hibernate objects in combination with lazily initializing collections. If you have such a data model, consider using RMI or HTTP invokers instead of Hessian.
    Hessian 和或 Burlap可以支持重要的值,當(dāng)在一個(gè)異質(zhì)的環(huán)境操作,因?yàn)樗麄兠鞔_的允許為非java 對(duì)象。然而非java對(duì)象是受限制的,知道的問題包括hibernate對(duì)象序列化與懶漢初始化集合的結(jié)合上。如果你有這樣的數(shù)據(jù)模型,考慮使用RMI或HTTP invokers而不是Hessioan.

    JMS can be useful for providing clusters of services and allowing the JMS broker to take care of load balancing, discovery and auto-failover. By default Java serialization is used when using JMS remoting but the JMS provider could use a different mechanism for the wire formatting, such as XStream to allow servers to be implemented in other technologies.


    Last but not least, EJB has an advantage over RMI in that it supports standard role-based authentication and authorization and remote transaction propagation. It is possible to get RMI invokers or HTTP invokers to support security context propagation as well, although this is not provided by core Spring: There are just appropriate hooks for plugging in third-party or custom solutions here.

     

    posted @ 2005-06-24 10:15 java世界暢談 閱讀(669) | 評(píng)論 (0)編輯 收藏

    20.2.1. 緩存映射(Cache mappings)

    類或者集合映射的“<cache>元素”可以有下列形式:

    <cache 
        usage="transactional|read-write|nonstrict-read-write|read-only"  (1)
    />
    (1)

    usage說明了緩存的策略: transactional、 read-writenonstrict-read-writeread-only。

    另外(首選?), 你可以在hibernate.cfg.xml中指定<class-cache><collection-cache> 元素。

    這里的usage 屬性指明了緩存并發(fā)策略(cache concurrency strategy)。

    20.2.2. 策略:只讀緩存(Strategy: read only)

    如果你的應(yīng)用程序只需讀取一個(gè)持久化類的實(shí)例,而無需對(duì)其修改, 那么就可以對(duì)其進(jìn)行只讀 緩存。這是最簡(jiǎn)單,也是實(shí)用性最好的方法。甚至在集群中,它也能完美地運(yùn)作。

    <class name="eg.Immutable" mutable="false">
        <cache usage="read-only"/>
        ....
    </class>

    20.2.3.  策略:讀/寫緩存(Strategy: read/write)

    如果應(yīng)用程序需要更新數(shù)據(jù),那么使用讀/寫緩存 比較合適。 如果應(yīng)用程序要求“序列化事務(wù)”的隔離級(jí)別(serializable transaction isolation level),那么就決不能使用這種緩存策略。 如果在JTA環(huán)境中使用緩存,你必須指定hibernate.transaction.manager_lookup_class屬性的值, 通過它,Hibernate才能知道該應(yīng)用程序中JTA的TransactionManager的具體策略。 在其它環(huán)境中,你必須保證在Session.close()、或Session.disconnect()調(diào)用前, 整個(gè)事務(wù)已經(jīng)結(jié)束。 如果你想在集群環(huán)境中使用此策略,你必須保證底層的緩存實(shí)現(xiàn)支持鎖定(locking)。Hibernate內(nèi)置的緩存策略并不支持鎖定功能。

    <class name="eg.Cat" .... >
        <cache usage="read-write"/>
        ....
        <set name="kittens" ... >
            <cache usage="read-write"/>
            ....
        </set>
    </class>

    20.2.4.  策略:非嚴(yán)格讀/寫緩存(Strategy: nonstrict read/write)

    如果應(yīng)用程序只偶爾需要更新數(shù)據(jù)(也就是說,兩個(gè)事務(wù)同時(shí)更新同一記錄的情況很不常見),也不需要十分嚴(yán)格的事務(wù)隔離, 那么比較適合使用非嚴(yán)格讀/寫緩存策略。如果在JTA環(huán)境中使用該策略, 你必須為其指定hibernate.transaction.manager_lookup_class屬性的值, 在其它環(huán)境中,你必須保證在Session.close()、或Session.disconnect()調(diào)用前, 整個(gè)事務(wù)已經(jīng)結(jié)束

    -------------------------------------------------------------------------
    在jBPM 中使用不少這樣的非嚴(yán)格讀/寫緩存的處理:
    <?xml version="1.0"?>

    <!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "

    <hibernate-mapping default-access="field">

      <class name="org.jbpm.context.def.VariableAccess"
             table="JBPM_VARIABLEACCESS"
             lazy="false">
        <cache usage="nonstrict-read-write"/>
        <id name="id" column="ID_"><generator class="native" /></id>
       
        <property name="variableName" column="VARIABLENAME_" />
        <property name="access" column="ACCESS_" />
        <property name="mappedName" column="MAPPEDNAME_" />
      </class>

    </hibernate-mapping>

    它的ehcache.xml 是這樣配置的:
    <ehcache>
     <defaultCache
            maxElementsInMemory="100000"
            eternal="true"
            overflowToDisk="false"
            diskPersistent="false"
            />
    </ehcache>

    posted @ 2005-06-22 17:32 java世界暢談 閱讀(739) | 評(píng)論 (0)編輯 收藏

    僅列出標(biāo)題
    共29頁: First 上一頁 21 22 23 24 25 26 27 28 29 下一頁 
    主站蜘蛛池模板: 免费成人午夜视频| 久草福利资源网站免费| 亚洲AV无码一区二区三区鸳鸯影院| 全免费毛片在线播放| 18禁黄网站禁片免费观看不卡| 久久免费视频99| 67194国产精品免费观看| 7x7x7x免费在线观看| 99久在线国内在线播放免费观看| 无码午夜成人1000部免费视频| 久久久久免费看黄a级试看| 无码人妻一区二区三区免费看| 亚洲免费在线播放| 1000部拍拍拍18勿入免费视频软件| 91精品免费久久久久久久久| 免费a级毛片无码a∨蜜芽试看| 破了亲妺妺的处免费视频国产 | 亚洲av永久中文无码精品| 亚洲成a人无码亚洲成www牛牛| 国产成人综合亚洲一区| www在线观看播放免费视频日本| 久久久久国色AV免费观看| 日本视频免费高清一本18| aⅴ在线免费观看| 好爽又高潮了毛片免费下载| 国产又长又粗又爽免费视频| 亚洲视频一区二区| 亚洲伦另类中文字幕| 亚洲一区二区三区在线网站| 亚洲日韩精品无码专区加勒比☆ | 日韩精品亚洲人成在线观看| 激情综合亚洲色婷婷五月| 精品亚洲国产成人av| 国产精品成人免费观看| 亚洲免费在线播放| 日韩免费高清视频| 亚洲中文字幕日产乱码高清app| 亚洲天天在线日亚洲洲精| 亚洲人成色777777老人头| 91精品全国免费观看青青| 精品无码免费专区毛片|