⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 batch.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 2 页
字号:
msgid ""msgstr """Project-Id-Version: PACKAGE VERSION\n""Report-Msgid-Bugs-To: http://bugs.kde.org\n""POT-Creation-Date: 2007-10-25 07:47+0000\n""PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""Language-Team: LANGUAGE <LL@li.org>\n""MIME-Version: 1.0\n""Content-Type: text/plain; charset=UTF-8\n""Content-Transfer-Encoding: 8bit\n"#. Tag: title#: batch.xml:5#, no-c-formatmsgid "Batch processing"msgstr "Batch 처리"#. Tag: para#: batch.xml:7#, no-c-formatmsgid """A naive approach to inserting 100 000 rows in the database using Hibernate ""might look like this:"msgstr """Hibernate를 사용하여 데이터베이스 내에서 100 000 개의 행들을 삽입시키는 본래""의 접근법은 다음과 같다:"#. Tag: programlisting#: batch.xml:12#, no-c-formatmsgid """<![CDATA[Session session = sessionFactory.openSession();\n""Transaction tx = session.beginTransaction();\n""for ( int i=0; i<100000; i++ ) {\n""    Customer customer = new Customer(.....);\n""    session.save(customer);\n""}\n""tx.commit();\n""session.close();]]>"msgstr ""#. Tag: para#: batch.xml:14#, no-c-formatmsgid """This would fall over with an <literal>OutOfMemoryException</literal> ""somewhere around the 50 000th row. That's because Hibernate caches all the ""newly inserted <literal>Customer</literal> instances in the session-level ""cache."msgstr """이것은 50 000번째 행 가까운 곳에서 <literal>OutOfMemoryException</literal>으""로 떨어질 것이다. 그것은 Hibernate가 session-level 캐시 속에 모든 새로이 삽입""된 <literal>Customer</literal> 인스턴스들을 캐시시키기 때문이다."#. Tag: para#: batch.xml:20#, no-c-formatmsgid """In this chapter we'll show you how to avoid this problem. First, however, if ""you are doing batch processing, it is absolutely critical that you enable ""the use of JDBC batching, if you intend to achieve reasonable performance. ""Set the JDBC batch size to a reasonable number (say, 10-50):"msgstr """이 장에서 우리는 이 문제를 피하는 방법을 당신에게 보여줄 것이다. 하지만 먼저 ""당신이 배치 처리를 행하는 중이라면, 당신이 적당한 퍼포먼스를 성취하려고 할 경""우에 당신이 JDBC 배치 사용을 가능하게 하는 것은 절대적으로 필요하다. JDBC 배""치 사이즈를 적당한 숫자(10-50)로 설정하라:"#. Tag: programlisting#: batch.xml:27#, no-c-formatmsgid "<![CDATA[hibernate.jdbc.batch_size 20]]>"msgstr ""#. Tag: para#: batch.xml:29#, no-c-formatmsgid """Note that Hibernate disables insert batching at the JDBC level transparently ""if you use an <literal>identiy</literal> identifier generator."msgstr """만일 당신이 <literal>identiy</literal> 식별자 생성자를 사용할 경우 Hibernate""가 JDBC 레벨에서 투명하게 insert 배치작업을 사용불가능하게 한다는 점을 노트하""라."#. Tag: para#: batch.xml:34#, no-c-formatmsgid """You also might like to do this kind of work in a process where interaction ""with the second-level cache is completely disabled:"msgstr """당신은 또한 second-level 캐시를 가진 상호작용이 완전하게 불가능한 프로세스 내""에서 이런 종류의 작업을 행하고 싶어할 수도 있다:"#. Tag: programlisting#: batch.xml:39#, no-c-formatmsgid "<![CDATA[hibernate.cache.use_second_level_cache false]]>"msgstr ""#. Tag: para#: batch.xml:41#, no-c-formatmsgid """However, this is not absolutely necessary, since we can explicitly set the ""<literal>CacheMode</literal> to disable interaction with the second-level ""cache."msgstr """하지만 이것은 절대적으로 필요하지 않다. 왜냐하면 우리는 second-level 캐시와""의 상호작용을 불가능하도록 하기 위해 명시적으로 <literal>CacheMode</literal>""를 설정할 수 있기 때문이다."#. Tag: title#: batch.xml:47#, no-c-formatmsgid "Batch inserts"msgstr "Batch inserts"#. Tag: para#: batch.xml:49#, no-c-formatmsgid """When making new objects persistent, you must <literal>flush()</literal> and ""then <literal>clear()</literal> the session regularly, to control the size ""of the first-level cache."msgstr """새로운 객체들을 영속화 시킬 때, 당신은 first-level 캐시의 사이즈를 제어하기 ""위해 세션을 정기적으로 <literal>flush()</literal> 시키고 나서 <literal>clear""()</literal> 시켜야 한다."#. Tag: programlisting#: batch.xml:55#, no-c-formatmsgid """<![CDATA[Session session = sessionFactory.openSession();\n""Transaction tx = session.beginTransaction();\n""   \n""for ( int i=0; i<100000; i++ ) {\n""    Customer customer = new Customer(.....);\n""    session.save(customer);\n""    if ( i % 20 == 0 ) { //20, same as the JDBC batch size\n""        //flush a batch of inserts and release memory:\n""        session.flush();\n""        session.clear();\n""    }\n""}\n""   \n""tx.commit();\n""session.close();]]>"msgstr ""#. Tag: title#: batch.xml:60#, no-c-formatmsgid "Batch updates"msgstr "Batch updates"#. Tag: para#: batch.xml:62#, no-c-formatmsgid """For retrieving and updating data the same ideas apply. In addition, you need ""to use <literal>scroll()</literal> to take advantage of server-side cursors ""for queries that return many rows of data."msgstr """데이터 검색과 업데이트의 경우 동일한 개념들이 적용된다. 게다가 당신은 많은 데""이터 행들을 반환하는 질의들에 대해 서버-측 커서들의 장점을 취하는데 ""<literal>scroll()</literal>을 사용할 필요가 있다."#. Tag: programlisting#: batch.xml:68#, no-c-formatmsgid """<![CDATA[Session session = sessionFactory.openSession();\n""Transaction tx = session.beginTransaction();\n""   \n""ScrollableResults customers = session.getNamedQuery(\"GetCustomers\")\n""    .setCacheMode(CacheMode.IGNORE)\n""    .scroll(ScrollMode.FORWARD_ONLY);\n""int count=0;\n""while ( customers.next() ) {\n""    Customer customer = (Customer) customers.get(0);\n""    customer.updateStuff(...);\n""    if ( ++count % 20 == 0 ) {\n""        //flush a batch of updates and release memory:\n""        session.flush();\n""        session.clear();\n""    }\n""}\n""   \n""tx.commit();\n""session.close();]]>"msgstr ""#. Tag: title#: batch.xml:73#, no-c-formatmsgid "The StatelessSession interface"msgstr "StatelessSession 인터페이스"#. Tag: para#: batch.xml:74#, no-c-formatmsgid """Alternatively, Hibernate provides a command-oriented API that may be used ""for streaming data to and from the database in the form of detached objects. ""A <literal>StatelessSession</literal> has no persistence context associated ""with it and does not provide many of the higher-level life cycle semantics. ""In particular, a stateless session does not implement a first-level cache ""nor interact with any second-level or query cache. It does not implement ""transactional write-behind or automatic dirty checking. Operations performed ""using a stateless session do not ever cascade to associated instances. ""Collections are ignored by a stateless session. Operations performed via a ""stateless session bypass Hibernate's event model and interceptors. Stateless ""sessions are vulnerable to data aliasing effects, due to the lack of a first-""level cache. A stateless session is a lower-level abstraction, much closer ""to the underlying JDBC."msgstr """다른 방법으로 Hibernate는 분리된(detached) 객체들의 형식으로 데이터베이스로 ""그리고 데이터베이스로부터 데이터를 스트리밍하는데 사용될 수 있는 하나의 명령 ""지향 API를 제공한다. <literal>StatelessSession</literal>은 그것과 연관된 영""속 컨텍스트를 갖지 않고 많은 보다 높은 레벨의 생명 주기 의미를 제공하지 않는""다. 특히 하나의 상태 없는 세션은 첫 번째 레벨 캐시를 구현하지 않거나 임의의 ""두 번째 레벨 캐시 또는 질의 캐시와 상호작용하지 않는다. 그것은 전통적인 쓰기-""이면(write-behind)의 체킹이나 자동적인 dirty 체킹을 구현하지 않는다. 하나의 ""상태 없는 세션을 사용하여 수행된 연산들은 연관된 인스턴스들에 대해 케스케이""드 되지 않는다. 콜렉션들은 상태 없는 세션에 의해 무시된다. 상태없는 세션을 통""해 수행된 연산들은 Hibernate의 이벤트 모형과 인터셉터들을 우회한다. 상태없는 ""세션들은 첫번째-레벨의 캐시의 부족으로 인해 데이터 alias 효과들에 취약하다. ""상태없는 세션은 기본 JDBC에 훨씬 더 가까운 하나의 보다 낮은 레벨의 추상화""(abstraction)이다."#. Tag: programlisting#: batch.xml:89#, no-c-formatmsgid """<![CDATA[StatelessSession session = sessionFactory.openStatelessSession();\n""Transaction tx = session.beginTransaction();\n""   \n""ScrollableResults customers = session.getNamedQuery(\"GetCustomers\")\n""    .scroll(ScrollMode.FORWARD_ONLY);\n""while ( customers.next() ) {\n""    Customer customer = (Customer) customers.get(0);\n""    customer.updateStuff(...);\n""    session.update(customer);\n""}\n""   \n""tx.commit();\n""session.close();]]>"msgstr ""#. Tag: para#: batch.xml:91#, no-c-formatmsgid """Note that in this code example, the <literal>Customer</literal> instances ""returned by the query are immediately detached. They are never associated ""with any persistence context."msgstr """이 코드 예제에서, 질의에 의해 반환된 <literal>Customer</literal> 인스턴스들""은 곧바고 분리된다(detached). 그것들은 임의의 영속 컨텍스트와 결코 연관되지 ""않는다."#. Tag: para#: batch.xml:97#, no-c-formatmsgid """The <literal>insert(), update()</literal> and <literal>delete()</literal> ""operations defined by the <literal>StatelessSession</literal> interface are ""considered to be direct database row-level operations, which result in ""immediate execution of a SQL <literal>INSERT, UPDATE</literal> or ""<literal>DELETE</literal> respectively. Thus, they have very different ""semantics to the <literal>save(), saveOrUpdate()</literal> and ""<literal>delete()</literal> operations defined by the <literal>Session</""literal> interface."msgstr """<literal>StatelessSession</literal> 인터페이스에 의해 정의된 <literal>insert""(), update()</literal> 그리고 <literal>delete()</literal> 연산들은 직접적인 ""데이터베이스 저급 연산들로 갖주되고, 그것은 각각 하나의 SQL <literal>INSERT, ""UPDATE</literal> 또는 <literal>DELETE</literal>의 즉각적인 실행으로 귀결된""다. 따라서 그것들은 <literal>Session</literal> 인터페이스에 의해 정의된 ""<literal>save(), saveOrUpdate()</literal>와 <literal>delete()</literal> 연산""들과는 매우 다른 의미들을 갖는다."#. Tag: title#: batch.xml:110#, no-c-formatmsgid "DML-style operations"msgstr "DML-스타일 연산들"#. Tag: para#: batch.xml:112#, no-c-formatmsgid """As already discussed, automatic and transparent object/relational mapping is ""concerned with the management of object state. This implies that the object ""state is available in memory, hence manipulating (using the SQL ""<literal>Data Manipulation Language</literal> (DML) statements: ""<literal>INSERT</literal>, <literal>UPDATE</literal>, <literal>DELETE</""literal>) data directly in the database will not affect in-memory state. ""However, Hibernate provides methods for bulk SQL-style DML statement ""execution which are performed through the Hibernate Query Language (<link ""linkend=\"queryhql\">HQL</link>)."msgstr """이미 논의했듯이, 자동적이고 투명한 객체/관계형 매핑은 객체 상태에 대한 관리""에 관계된다. 이것은 객체 상태가 메모리 내에서 이용 가능함을 의미하므로, (SQL ""<literal>Data Manipulation Language</literal>(DML) 문장들 : <literal>INSERT</""literal>, <literal>UPDATE</literal>, <literal>DELETE</literal>를 사용하여) 데""이터베이스에서 직접 데이터를 업데이트하거나 삭제하는 것은 메모리 내 상태에 영""향을 주지 않을 것이다. 하지만 Hibernate는 Hibernate Query Language (<xref ""linkend=\"queryhql\">HQL</xref>)를 통해 실행되는 대량 SQL-스타일의 DML 문장 ""실행을 위한 메소드들을 제공한다."#. Tag: para#: batch.xml:122#, no-c-formatmsgid ""

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -