📄 performance.po
字号:
"Batch fetching for classes/entities is easier to understand. Imagine you ""have the following situation at runtime: You have 25 <literal>Cat</literal> ""instances loaded in a <literal>Session</literal>, each <literal>Cat</""literal> has a reference to its <literal>owner</literal>, a <literal>Person</""literal>. The <literal>Person</literal> class is mapped with a proxy, ""<literal>lazy=\"true\"</literal>. If you now iterate through all cats and ""call <literal>getOwner()</literal> on each, Hibernate will by default ""execute 25 <literal>SELECT</literal> statements, to retrieve the proxied ""owners. You can tune this behavior by specifying a <literal>batch-size</""literal> in the mapping of <literal>Person</literal>:"msgstr """클래스들/엔티티들에 대한 batch 페칭은 이해하기가 더 쉽다. 당신이 실행 시에 다""음 상황에 처한다고 상상하라: 당신은 하나의 <literal>Session</literal> 속에 로""드된 25개의 <literal>Cat</literal> 인스턴스들을 갖고 있고, 각각의 ""<literal>Cat</literal>은 그것의 <literal>소유자</literal> 즉, ""<literal>Person</literal>에 대한 참조를 갖고 있다. <literal>Person</literal> ""클래스는 프락시 <literal>lazy=\"true\"</literal>로서 매핑된다. 만일 당신이 이""제 모든 cat들을 통해 반복하고 각각의 cat에 대해 <literal>getOwner()</literal>""를 호출할 경우, Hibernate는 프락시된 소유자들을 검색하기 위해 25개의 ""<literal>SELECT</literal> 문장들을 디폴트로 실행시킬 것이다. 당신은 ""<literal>Person</literal> 매핑에서 <literal>batch-size</literal>를 지정함으로""써 이 동작을 튜닝시킬 수 있다:"#. Tag: programlisting#: performance.xml:479#, no-c-formatmsgid "<![CDATA[<class name=\"Person\" batch-size=\"10\">...</class>]]>"msgstr ""#. Tag: para#: performance.xml:481#, no-c-formatmsgid """Hibernate will now execute only three queries, the pattern is 10, 10, 5."msgstr """Hibernate는 이제 세 개의 질의들 만을 실행시킬 것이고, 그 패턴은 10,10, 5 이""다."#. Tag: para#: performance.xml:485#, no-c-formatmsgid """You may also enable batch fetching of collections. For example, if each ""<literal>Person</literal> has a lazy collection of <literal>Cat</literal>s, ""and 10 persons are currently loaded in the <literal>Sesssion</literal>, ""iterating through all persons will generate 10 <literal>SELECT</literal>s, ""one for every call to <literal>getCats()</literal>. If you enable batch ""fetching for the <literal>cats</literal> collection in the mapping of ""<literal>Person</literal>, Hibernate can pre-fetch collections:"msgstr """당신은 또한 콜렉션들에 대해 batch 페칭을 이용 가능하게 할 수도 있다. 예를 들""어, 만일 각각의 <literal>Person</literal>이 <literal>Cat</literal>들을 가진 ""lazy 콜렉션을 갖고, 10개의 person들이 <literal>Sesssion</literal> 내에 현재 ""로드되어 있을 경우, 모든 person들에 대한 반복은 10개의 <literal>SELECT</""literal>들을 생성시킬 것이고, <literal>getCats()</literal>에 대한 매번의 호출""에 대해 하나의 <literal>SELECT</literal>를 생성시킬 것이다. 만일 당신이 ""<literal>Person</literal> 매핑에서 <literal>cats</literal> 콜렉션에 대해 ""batch 페칭을 사용가능하게 할 경우, Hibernate는 콜렉션들을 미리-페치 시킬 수 ""있다:"#. Tag: programlisting#: performance.xml:494#, no-c-formatmsgid """<![CDATA[<class name=\"Person\">\n"" <set name=\"cats\" batch-size=\"3\">\n"" ...\n"" </set>\n""</class>]]>"msgstr ""#. Tag: para#: performance.xml:496#, no-c-formatmsgid """With a <literal>batch-size</literal> of 3, Hibernate will load 3, 3, 3, 1 ""collections in four <literal>SELECT</literal>s. Again, the value of the ""attribute depends on the expected number of uninitialized collections in a ""particular <literal>Session</literal>."msgstr """<literal>batch-size</literal> 8로서, Hibernate는 4개의 SELECT들에서 3, 3, 3, ""1 개의 콜렉션들을 로드시킬 것이다. 다시 그 속성의 값은 특정 ""<literal>Session</literal> 내에서 초기화 되지 않은 콜렉션들의 예상되는 개수""에 의존한다."#. Tag: para#: performance.xml:502#, no-c-formatmsgid """Batch fetching of collections is particularly useful if you have a nested ""tree of items, ie. the typical bill-of-materials pattern. (Although a ""<emphasis>nested set</emphasis> or a <emphasis>materialized path</emphasis> ""might be a better option for read-mostly trees.)"msgstr """만일 당신이 항목들의 포개진 트리를 가질 경우, 예를 들어 전형적인 bill-of-""materials 패턴인 경우, (비록 <emphasis>내포된 set</emphasis> 또는 <emphasis>""실체화된 경로(materialized path)</emphasis>가 주로-읽기-트리들에 대해 더 좋""은 옵션일 수 있을지라도) 콜렉션들에 대한 batch 페칭이 특히 유용하다."#. Tag: title#: performance.xml:511#, no-c-formatmsgid "Using subselect fetching"msgstr "subselect 페칭 사용하기"#. Tag: para#: performance.xml:513#, no-c-formatmsgid """If one lazy collection or single-valued proxy has to be fetched, Hibernate ""loads all of them, re-running the original query in a subselect. This works ""in the same way as batch-fetching, without the piecemeal loading."msgstr """만일 한 개의 lazy 콜렉션이나 단일 값 프락시가 페치되어야 한다면, Hibernate는 ""하나의 subselect 내에서 원래의 질의를 다시 실행하여 그것들 모두를 로드시킨""다. 이것은 조각난 로딩 없이 batch 페칭과 동일한 방식으로 동작한다."#. Tag: title#: performance.xml:524#, no-c-formatmsgid "Using lazy property fetching"msgstr "lazy 프로퍼티 페칭 사용하기"#. Tag: para#: performance.xml:526#, no-c-formatmsgid """Hibernate3 supports the lazy fetching of individual properties. This ""optimization technique is also known as <emphasis>fetch groups</emphasis>. ""Please note that this is mostly a marketing feature, as in practice, ""optimizing row reads is much more important than optimization of column ""reads. However, only loading some properties of a class might be useful in ""extreme cases, when legacy tables have hundreds of columns and the data ""model can not be improved."msgstr """Hibernate3은 개별적인 프로퍼티들에 대한 lazy 페칭을 지원한다. 이 최적화 기술""은 또한 <emphasis>fetch groups</emphasis> 으로 알려져 있다. 이것이 대개 마케""팅 특징임을 노트하길 바란다. 왜냐하면 실제로 행 읽기를 최적화 시키는 것이 컬""럼 읽기에 대한 최적화 보다 훨씬 더 중요하기 때문이다. 하지만 리거시 테이블들""이 수백 개의 컬럼들을 갖고 데이터 모형이 개선될 수 없을 때, 오직 클래스의 몇""몇 프로퍼티들을 로드시키는 것 만이 유용할 수도 있다."#. Tag: para#: performance.xml:535#, no-c-formatmsgid """To enable lazy property loading, set the <literal>lazy</literal> attribute ""on your particular property mappings:"msgstr """lazy 프로퍼티 로딩을 이용가능하게 하려면, 당신의 특정 property 매핑들에 대해 ""<literal>lazy</literal> 속성을 설정하라:"#. Tag: programlisting#: performance.xml:540#, no-c-formatmsgid """<![CDATA[<class name=\"Document\">\n"" <id name=\"id\">\n"" <generator class=\"native\"/>\n"" </id>\n"" <property name=\"name\" not-null=\"true\" length=\"50\"/>\n"" <property name=\"summary\" not-null=\"true\" length=\"200\" lazy=\"true""\"/>\n"" <property name=\"text\" not-null=\"true\" length=\"2000\" lazy=\"true\"/"">\n""</class>]]>"msgstr ""#. Tag: para#: performance.xml:542#, no-c-formatmsgid """Lazy property loading requires buildtime bytecode instrumentation! If your ""persistent classes are not enhanced, Hibernate will silently ignore lazy ""property settings and fall back to immediate fetching."msgstr """Lazy property 로딩은 빌드 시 바이트코드 수단을 필요로 한다! 만일 당신의 영속 ""클래스들이 개선되지 않을 경우, Hibernate는 조용하게 lazy 프로퍼티 설정들을 무""시하고 즉각적인 페칭으로 후퇴할 것이다."#. Tag: para#: performance.xml:548#, no-c-formatmsgid "For bytecode instrumentation, use the following Ant task:"msgstr "bytecode 수단으로, 다음 Ant 태스크를 사용하라:"#. Tag: programlisting#: performance.xml:552#, no-c-formatmsgid """<![CDATA[<target name=\"instrument\" depends=\"compile\">\n"" <taskdef name=\"instrument\" classname=\"org.hibernate.tool.instrument.""InstrumentTask\">\n"" <classpath path=\"${jar.path}\"/>\n"" <classpath path=\"${classes.dir}\"/>\n"" <classpath refid=\"lib.class.path\"/>\n"" </taskdef>\n""\n"" <instrument verbose=\"true\">\n"" <fileset dir=\"${testclasses.dir}/org/hibernate/auction/model\">\n"" <include name=\"*.class\"/>\n"" </fileset>\n"" </instrument>\n""</target>]]>"msgstr ""#. Tag: para#: performance.xml:554#, no-c-formatmsgid """A different (better?) way to avoid unnecessary column reads, at least for ""read-only transactions is to use the projection features of HQL or Criteria ""queries. This avoids the need for buildtime bytecode processing and is ""certainly a prefered solution."msgstr """불필요한 컬럼 읽기를 피하는 다른 (더 좋은?) 방법은 적어도 읽기 전용 트랜잭션""의 경우에 HQL 질의 또는 Criteria 질의의 투사(projection) 특징들을 사용하는 것""이다. 이것은 빌드 시 바이트코드 처리에 대한 필요성을 피하게 해주고 확실히 선""호되는 해결책이다."#. Tag: para#: performance.xml:561#, no-c-formatmsgid """You may force the usual eager fetching of properties using <literal>fetch ""all properties</literal> in HQL."msgstr """당신은 HQL에서 <literal>fetch all properties</literal>를 사용하여 프로퍼티들""에 대한 통상의 eager 페칭을 강제시킬 수 있다."#. Tag: title#: performance.xml:571#, no-c-formatmsgid "The Second Level Cache"msgstr "두번째 레벨 캐시"#. Tag: para#: performance.xml:573#, no-c-formatmsgid """A Hibernate <literal>Session</literal> is a transaction-level cache of ""persistent data. It is possible to configure a cluster or JVM-level ""(<literal>SessionFactory</literal>-level) cache on a class-by-class and ""collection-by-collection basis. You may even plug in a clustered cache. Be ""careful. Caches are never aware of changes made to the persistent store by ""another application (though they may be configured to regularly expire ""cached data)."msgstr """Hibernate <literal>Session</literal>은 영속 데이터에 대한 트랜잭션 레벨 캐시""이다. class-by-class와 collection-by-collection 기반 위에 클러스터 또는 JVM-""레벨(<literal>SessionFactory</literal>-레벨) 캐시를 구성하는 것이 가능하다. ""당신은 클러스터링 된 캐시 속에 플러그인 할 수도 있다. 주의하라. 캐시들은 (비""록 그것들이 캐시된 데이터를 정기적으로 만료되도록 구성되어 있을지라도) 또 다""른 어플리케이션에 의해 영속 저장소에 대해 행해진 변경들을 결코 알지 못한다."#. Tag: para#: performance.xml:581#, no-c-formatmsgid """You have the option to tell Hibernate which caching implementation to use by ""specifying the name of a class that implements <literal>org.hibernate.cache.""CacheProvider</literal> using the property <literal>hibernate.cache.""provider_class</literal>. Hibernate comes bundled with a number of built-in ""integrations with open-source cache providers (listed below); additionally, ""you could implement your own and plug it in as outlined above. Note that ""versions prior to 3.2 defaulted to use EhCache as the default cache ""provider; that is no longer the case as of 3.2."msgstr """디폴트로, Hibernate는 JVM-레벨의 캐싱에 EHCache를 사용한다. (JCS 지원은 이제 ""진부하게 되었고 Hibernate의 장래 버전에서 제거될 것이다.) 당신은 ""<literal>hibernate.cache.provider_class</literal> 프로퍼티를 사용하여 ""<literal>org.hibernate.cache.CacheProvider</literal>를 구현하는 클래스의 이름""을 지정함으로써 다른 구현을 선택할 수도 있다. You have the option to tell ""Hibernate which caching implementation to use by specifying the name of a ""class that implements <literal>org.hibernate.cache.CacheProvider</literal> ""using the property <literal>hibernate.cache.provider_class</literal>. ""Hibernate comes bundled with a number of built-in integrations with open-""source cache providers (listed below); additionally, you could implement ""your own and plug it in as outlined above. Note that versions prior to 3.2 ""defaulted to use EhCache as the default cache provider; that is no longer ""the case as of 3.2. 당신은 <literal>hibernate.cache.provider_class</literal> ""프로퍼티를 사용하여 <literal>org.hibernate.cache.CacheProvider</literal>를 구""현하는 클래스의 이름을 지정함으로써 어느 캐싱 구현을 사용할 것인지를 ""Hibernate에게 알려주는 옵션을 갖는다. Hibernate는 (아래에 열거된) 오픈-소스 ""프로바이더들을 가진 많은 빌드되어 있는 통합들을 번들로 갖고 있다; 추가적으로 ""당신은 위에서 언급했듯이 그것에 당신 자신의 것을 구현할 수 있고 그것에 플러""그 시킬 수 있다. 3.2 이번 버전들은 디플트 캐시 프로바이더로서 EhCache를 사용""하도록 디포릍로 내장되어 있음을 노트하라; 버전 3.2의 경우에 그것은 더이상 디""폴트 내장이 아니다."#. Tag: title#: performance.xml:592#, no-c-formatmsgid "Cache Providers"msgstr "캐시 프로바이더들"#. Tag: entry#: performance.xml:601 performance.xml:774#, no-c-formatmsgid "Cache"msgstr "캐시"#. Tag: entry#: performance.xml:602#, no-c-formatmsgid "Provider class"msgstr "프로바이더 클래스"#. Tag: entry#: performance.xml:603#, no-c-formatmsgid "Type"msgstr "타입"#. Tag: entry
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -