📄 transactions.po
字号:
#, no-c-formatmsgid "flush the session"msgstr "세션을 flush 시킨다"#. Tag: para#: transactions.xml:414#, no-c-formatmsgid "commit the transaction"msgstr "트랜잭션을 커밋 시킨다"#. Tag: para#: transactions.xml:419#, no-c-formatmsgid "close the session"msgstr "세션을 닫는다"#. Tag: para#: transactions.xml:424#, no-c-formatmsgid "handle exceptions"msgstr "예외상황들을 처리한다"#. Tag: para#: transactions.xml:430#, no-c-formatmsgid """Flushing the session has been discussed earlier, we'll now have a closer ""look at transaction demarcation and exception handling in both managed- and ""non-managed environments."msgstr """세션을 flush 시키는 것은 앞서 논의되었고, 우리는 이제 관리되는 환경과 관리되""지 않는 환경 양자에서 트랜잭션 경계 설정과 예외상황을 더 자세히 살펴볼 것이""다."#. Tag: title#: transactions.xml:437#, no-c-formatmsgid "Non-managed environment"msgstr "관리되지 않는 환경"#. Tag: para#: transactions.xml:439#, no-c-formatmsgid """If a Hibernate persistence layer runs in a non-managed environment, database ""connections are usually handled by simple (i.e. non-DataSource) connection ""pools from which Hibernate obtains connections as needed. The session/""transaction handling idiom looks like this:"msgstr """만일 Hibernate 영속 계층이 관리되지 않는(non-managed) 환경에서 실행될 경우, ""데이터베이스 커넥션들은 대개 Hibernate가 필요로할 때 커넥션들을 획득하는 간단""한 (예를 들면 DataSource가 아닌) 커넥션 풀(pool)들로부터 처리된다. session/""transaction 처리 관용구는 다음과 같다:"#. Tag: programlisting#: transactions.xml:446#, no-c-formatmsgid """<![CDATA[// Non-managed environment idiom\n""Session sess = factory.openSession();\n""Transaction tx = null;\n""try {\n"" tx = sess.beginTransaction();\n""\n"" // do some work\n"" ...\n""\n"" tx.commit();\n""}\n""catch (RuntimeException e) {\n"" if (tx != null) tx.rollback();\n"" throw e; // or display error message\n""}\n""finally {\n"" sess.close();\n""}]]>"msgstr ""#. Tag: para#: transactions.xml:448#, no-c-formatmsgid """You don't have to <literal>flush()</literal> the <literal>Session</literal> ""explicitly - the call to <literal>commit()</literal> automatically triggers ""the synchronization (depending upon the <link linkend=\"objectstate-flushing""\">FlushMode</link> for the session. A call to <literal>close()</literal> ""marks the end of a session. The main implication of <literal>close()</""literal> is that the JDBC connection will be relinquished by the session. ""This Java code is portable and runs in both non-managed and JTA environments."msgstr """당신은 <literal>Session</literal>을 명시적으로 <literal>flush()</literal> 하""지 말아야 한다 - <literal>commit()</literal>에 대한 호출은 (그 세션에 대한 ""<xref linkend=\"objectstate-flushing\">FlushMode</xref>에 따라)자동적으로 동""기화를 트리거시킨다. <literal>close()</literal>에 대한 호출은 세션의 끝을 마""크한다. <literal>close()</literal>의 주된 구현은 JDBC 커넥션이 그 세션에 의""해 포기될 것이라는 점이다. 이 Java 코드는 관리되지 않는 환경과 JTA 환경 양자""에서 이식성이 있고 실행된다."#. Tag: para#: transactions.xml:457#, no-c-formatmsgid """A much more flexible solution is Hibernate's built-in \"current session\" ""context management, as described earlier:"msgstr """보다 더 유연한 해결책은 앞서 설명했듯이 Hibernate의 미리 빌드되어 있는 \"현""재 세션\" 컨텍스트 관리이다:"#. Tag: programlisting#: transactions.xml:462#, no-c-formatmsgid """<![CDATA[// Non-managed environment idiom with getCurrentSession()\n""try {\n"" factory.getCurrentSession().beginTransaction();\n""\n"" // do some work\n"" ...\n""\n"" factory.getCurrentSession().getTransaction().commit();\n""}\n""catch (RuntimeException e) {\n"" factory.getCurrentSession().getTransaction().rollback();\n"" throw e; // or display error message\n""}]]>"msgstr ""#. Tag: para#: transactions.xml:464#, no-c-formatmsgid """You will very likely never see these code snippets in a regular application; ""fatal (system) exceptions should always be caught at the \"top\". In other ""words, the code that executes Hibernate calls (in the persistence layer) and ""the code that handles <literal>RuntimeException</literal> (and usually can ""only clean up and exit) are in different layers. The current context ""management by Hibernate can significantly simplify this design, as all you ""need is access to a <literal>SessionFactory</literal>. Exception handling is ""discussed later in this chapter."msgstr """당신은 통상의 어플리케이션에서 비지니스 코드 속에 이 관용구를 결코 보지 않을 ""것이다; 치명적인(시스템) 예외상황들은 항상 \"상단\"에서 잡혀야 한다. 달리 말""해, (영속 계층에서) Hibernate 호출들을 실행시키는 코드와 ""<literal>RuntimeException</literal>을 처리하(고 대개 오직 제거하고 빠져나갈 ""수 있는) 코드는 다른 계층들 속에 있다. Hibernate에 의한 현재 컨텍스트 관리는 ""이 설계를 현격하게 단순화시켜서, 당신이 필요로 하는 모든 것은 ""<literal>SessionFactory</literal>에 대한 접근이다.예외상황 처리는 이 장의 뒷""부분에서 논의된다."#. Tag: para#: transactions.xml:474#, no-c-formatmsgid """Note that you should select <literal>org.hibernate.transaction.""JDBCTransactionFactory</literal> (which is the default), and for the second ""example <literal>\"thread\"</literal> as your <literal>hibernate.""current_session_context_class</literal>."msgstr """당신은 (디폴트인) <literal>org.hibernate.transaction.JDBCTransactionFactory</""literal>를 선택해야 하고, 두번째 예제의 경우 당신의 <literal>hibernate.""current_session_context_class</literal>를 선택해야 함을 노트하라."#. Tag: title#: transactions.xml:483#, no-c-formatmsgid "Using JTA"msgstr "JTA 사용하기"#. Tag: para#: transactions.xml:485#, no-c-formatmsgid """If your persistence layer runs in an application server (e.g. behind EJB ""session beans), every datasource connection obtained by Hibernate will ""automatically be part of the global JTA transaction. You can also install a ""standalone JTA implementation and use it without EJB. Hibernate offers two ""strategies for JTA integration."msgstr """만일 당신의 영속 계층이 어플리케이션 서버에서(예를 들어, EJB 세션 빈즈 이면에""서) 실행될 경우, Hibernate에 의해 획득된 모든 데이터소스 커넥션은 자동적으로 ""전역 JTA 트랜잭션의 부분일 것이다. 당신은 또한 스탠드얼론 JTA 구현을 설치할 ""수 있고 EJB 없이 그것을 사용할 수 있다. Hibernate는 JTA 통합을 위한 두 개의 ""방도들을 제공한다."#. Tag: para#: transactions.xml:492#, no-c-formatmsgid """If you use bean-managed transactions (BMT) Hibernate will tell the ""application server to start and end a BMT transaction if you use the ""<literal>Transaction</literal> API. So, the transaction management code is ""identical to the non-managed environment."msgstr """만일 당신이 bean-managed transactions(BMT)를 사용할 경우 Hibernate는 당신이 ""<literal>Transaction</literal> API를 사용할 경우에 BMT 트랜잭션을 시작하고 종""료하도록 어플리케이션 서버에게 알려줄 것이다. 따라서 트랜잭션 관리 코드는 ""non-managed 환경과 동일하다."#. Tag: programlisting#: transactions.xml:498#, no-c-formatmsgid """<![CDATA[// BMT idiom\n""Session sess = factory.openSession();\n""Transaction tx = null;\n""try {\n"" tx = sess.beginTransaction();\n""\n"" // do some work\n"" ...\n""\n"" tx.commit();\n""}\n""catch (RuntimeException e) {\n"" if (tx != null) tx.rollback();\n"" throw e; // or display error message\n""}\n""finally {\n"" sess.close();\n""}]]>"msgstr ""#. Tag: para#: transactions.xml:500#, no-c-formatmsgid """If you want to use a transaction-bound <literal>Session</literal>, that is, ""the <literal>getCurrentSession()</literal> functionality for easy context ""propagation, you will have to use the JTA <literal>UserTransaction</literal> ""API directly:"msgstr """만일 당신이 트랜잭션에 묶인 <literal>Session</literal>, 즉 쉬운 컨텍스트 보급""을 위한 <literal>getCurrentSession()</literal> 기능을 사용하고자 원할 경우, ""당신은 JTA <literal>UserTransaction</literal> API를 직접 사용해야 할 것이다:"#. Tag: programlisting#: transactions.xml:506#, no-c-formatmsgid """<![CDATA[// BMT idiom with getCurrentSession()\n""try {\n"" UserTransaction tx = (UserTransaction)new InitialContext()\n"" .lookup(\"java:comp/UserTransaction\");\n""\n"" tx.begin();\n""\n"" // Do some work on Session bound to transaction\n"" factory.getCurrentSession().load(...);\n"" factory.getCurrentSession().persist(...);\n""\n"" tx.commit();\n""}\n"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -