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

📄 transactions.po

📁 hibernate 开源框架的代码 jar包希望大家能喜欢
💻 PO
📖 第 1 页 / 共 5 页
字号:
"silly limitation of the JTA spec, it is not possible for Hibernate to ""automatically clean up any unclosed <literal>ScrollableResults</literal> or ""<literal>Iterator</literal> instances returned by <literal>scroll()</""literal> or <literal>iterate()</literal>. You <emphasis>must</emphasis> ""release the underlying database cursor by calling <literal>ScrollableResults.""close()</literal> or <literal>Hibernate.close(Iterator)</literal> explicity ""from a <literal>finally</literal> block. (Of course, most applications can ""easily avoid using <literal>scroll()</literal> or <literal>iterate()</""literal> at all from the JTA or CMT code.)"msgstr """Existe una advertencia al uso del modo de liberación de conexión ""<literal>after_statement</literal>. Debido a una limitación tonta de la ""especificación de JTA, no es posible para Hibernate limpiar automáticamente ""ningún <literal>ScrollableResults</literal> no cerrado ni instancias de ""<literal>Iterator</literal> devueltas por <literal>scroll()</literal> o ""<literal>iterate()</literal>. <emphasis>Debes</emphasis> liberar el cursor ""de base de datos subyacente llamando a <literal>ScrollableResults.close()</""literal> o <literal>Hibernate.close(Iterator)</literal> explícitamente desde ""un bloque <literal>finally</literal>. (Por supuesto, la mayoría de las ""aplicaciones pueden evitarlo fácilmente no usando en absoluto ningún ""<literal>scroll()</literal> o <literal>iterate()</literal> desde el código ""CMT.)"#. Tag: title#: transactions.xml:524#, no-c-formatmsgid "Exception handling"msgstr "Manejo de excepciones"#. Tag: para#: transactions.xml:526#, no-c-formatmsgid """If the <literal>Session</literal> throws an exception (including any ""<literal>SQLException</literal>), you should immediately rollback the ""database transaction, call <literal>Session.close()</literal> and discard ""the <literal>Session</literal> instance. Certain methods of ""<literal>Session</literal> will <emphasis>not</emphasis> leave the session ""in a consistent state. No exception thrown by Hibernate can be treated as ""recoverable. Ensure that the <literal>Session</literal> will be closed by ""calling <literal>close()</literal> in a <literal>finally</literal> block."msgstr """Si la <literal>Session</literal> lanza una excepción (incluyendo cualquier ""<literal>SQLException</literal>), debes inmediatamente deshacer (rollback) ""la transacción de base de datos, llamar a <literal>Session.close()</literal> ""y descartar la instancia de <literal>Session</literal>. Ciertos métodos de ""<literal>Session</literal><emphasis>no</emphasis> dejarán la sesión en un ""estado consistente. Ninguna excepción lanzada por Hibernate puede ser ""tratada como recuperable. Asegúrate que la <literal>Session</literal> sea ""cerrada llamando a <literal>close()</literal> en un bloque <literal>finally</""literal>."#. Tag: para#: transactions.xml:537#, no-c-formatmsgid """The <literal>HibernateException</literal>, which wraps most of the errors ""that can occur in a Hibernate persistence layer, is an unchecked exception ""(it wasn't in older versions of Hibernate). In our opinion, we shouldn't ""force the application developer to catch an unrecoverable exception at a low ""layer. In most systems, unchecked and fatal exceptions are handled in one of ""the first frames of the method call stack (i.e. in higher layers) and an ""error message is presented to the application user (or some other ""appropriate action is taken). Note that Hibernate might also throw other ""unchecked exceptions which are not a <literal>HibernateException</literal>. ""These are, again, not recoverable and appropriate action should be taken."msgstr """La <literal>HibernateException</literal>, que envuelve la mayoría de los ""errores que pueden ocurrir en la capa de persistencia de Hibernate, en una ""excepción no chequeada (no lo era en versiones anteriores de Hibernate). En ""nuestra opinión, no debemos forzar al desarrollador de aplicaciones a ""capturar una excepción irrecuperable en una capa baja. En la mayoría de los ""sistemas, las excepciones no chequeadas y fatales son manejadas en uno de ""los primeros cuadros de la pila de llamadas a métodos (es decir, en las ""capas más altas) y se presenta un mensaje de error al usuario de la ""aplicación (o se toma alguna otra acción apropiada). Nota que Hibernate ""podría también lanzar otras excepciones no chequeadas que no sean una ""<literal>HibernateException</literal>. Una vez más, no son recuperables y ""debe tomarse una acción apropiada."#. Tag: para#: transactions.xml:549#, no-c-formatmsgid """Hibernate wraps <literal>SQLException</literal>s thrown while interacting ""with the database in a <literal>JDBCException</literal>. In fact, Hibernate ""will attempt to convert the eexception into a more meningful subclass of ""<literal>JDBCException</literal>. The underlying <literal>SQLException</""literal> is always available via <literal>JDBCException.getCause()</""literal>. Hibernate converts the <literal>SQLException</literal> into an ""appropriate <literal>JDBCException</literal> subclass using the ""<literal>SQLExceptionConverter</literal> attached to the ""<literal>SessionFactory</literal>. By default, the ""<literal>SQLExceptionConverter</literal> is defined by the configured ""dialect; however, it is also possible to plug in a custom implementation ""(see the javadocs for the <literal>SQLExceptionConverterFactory</literal> ""class for details). The standard <literal>JDBCException</literal> subtypes ""are:"msgstr """Hibernate envuelve <literal>SQLException</literal>s lanzadas mientras se ""interactúa con la base de datos en una <literal>JDBCException</literal>. De ""hecho, Hibernate intentará convertir la excepción en una subclase de ""<literal>JDBCException</literal> más significativa. La ""<literal>SQLException</literal> está siempre disponible vía ""<literal>JDBCException.getCause()</literal>. Hibernate convierte la ""<literal>SQLException</literal> en una subclase de <literal>JDBCException</""literal> apropiada usando el <literal>SQLExceptionConverter</literal> ""adjunto a la <literal>SessionFactory</literal>. Por defecto, el ""<literal>SQLExceptionConverter</literal> está definido para el dialecto ""configurado; sin embargo, es también posible enchufar una implementación ""personalizada (ver los javadocs de la clase ""<literal>SQLExceptionConverterFactory</literal> para los detalles). Los ""subtipos estándar de <literal>JDBCException</literal> son:"#. Tag: para#: transactions.xml:565#, no-c-formatmsgid """<literal>JDBCConnectionException</literal> - indicates an error with the ""underlying JDBC communication."msgstr """<literal>JDBCConnectionException</literal> - indica un error con la ""comunicación JDBC subyacente."#. Tag: para#: transactions.xml:571#, no-c-formatmsgid """<literal>SQLGrammarException</literal> - indicates a grammar or syntax ""problem with the issued SQL."msgstr """<literal>SQLGrammarException</literal> - indica un problema de gramática o ""sintáxis con el SQL publicado."#. Tag: para#: transactions.xml:577#, no-c-formatmsgid """<literal>ConstraintViolationException</literal> - indicates some form of ""integrity constraint violation."msgstr """<literal>ConstraintViolationException</literal> - indica alguna forma de ""violación de restricción de integridad."#. Tag: para#: transactions.xml:583#, no-c-formatmsgid """<literal>LockAcquisitionException</literal> - indicates an error acquiring a ""lock level necessary to perform the requested operation."msgstr """<literal>LockAcquisitionException</literal> - indica un error adquiriendo un ""nivel de bloqueo necesario para realizar una operación solicitada."#. Tag: para#: transactions.xml:589#, no-c-formatmsgid """<literal>GenericJDBCException</literal> - a generic exception which did not ""fall into any of the other categories."msgstr """<literal>GenericJDBCException</literal> - una excepción genérica que no cayó ""en ninguna de las otras categorías."#. Tag: title#: transactions.xml:599#, no-c-formatmsgid "Transaction timeout"msgstr "Transaction timeout"#. Tag: para#: transactions.xml:601#, no-c-formatmsgid """One extremely important feature provided by a managed environment like EJB ""that is never provided for non-managed code is transaction timeout. ""Transaction timeouts ensure that no misbehaving transaction can indefinitely ""tie up resources while returning no response to the user. Outside a managed ""(JTA) environment, Hibernate cannot fully provide this functionality. ""However, Hibernate can at least control data access operations, ensuring ""that database level deadlocks and queries with huge result sets are limited ""by a defined timeout. In a managed environment, Hibernate can delegate ""transaction timeout to JTA. This functioanlity is abstracted by the ""Hibernate <literal>Transaction</literal> object."msgstr """One extremely important feature provided by a managed environment like EJB ""that is never provided for non-managed code is transaction timeout. ""Transaction timeouts ensure that no misbehaving transaction can indefinitely ""tie up resources while returning no response to the user. Outside a managed ""(JTA) environment, Hibernate cannot fully provide this functionality. ""However, Hibernate can at least control data access operations, ensuring ""that database level deadlocks and queries with huge result sets are limited ""by a defined timeout. In a managed environment, Hibernate can delegate ""transaction timeout to JTA. This functioanlity is abstracted by the ""Hibernate <literal>Transaction</literal> object."#. Tag: programlisting#: transactions.xml:614#, no-c-formatmsgid """<![CDATA[\n""Session sess = factory.openSession();\n""try {\n""    //set transaction timeout to 3 seconds\n""    sess.getTransaction().setTimeout(3);\n""    sess.getTransaction().begin();\n""\n""    // do some work\n""    ...\n""\n""    sess.getTransaction().commit()\n""}\n""catch (RuntimeException e) {\n""    sess.getTransaction().rollback();\n""    throw e; // or display error message\n""}\n""finally {\n""    sess.close();\n""}]]>"msgstr ""#. Tag: para#: transactions.xml:616#, no-c-formatmsgid """Note that <literal>setTimeout()</literal> may not be called in a CMT bean, ""where transaction timeouts must be defined declaratively."msgstr """Note that <literal>setTimeout()</literal> may not be called in a CMT bean, ""where transaction timeouts must be defined declaratively."#. Tag: title#: transactions.xml:626#, no-c-formatmsgid "Optimistic concurrency control"msgstr "Control optimista de concurrencia"#. Tag: para#: transactions.xml:628#, no-c-formatmsgid """The only approach that is consistent with high concurrency and high ""scalability is optimistic concurrency control with versioning. Version ""checking uses version numbers, or timestamps, to detect conflicting updates ""(and to prevent lost updates). Hibernate provides for three possible ""approaches to writing application code that uses optimistic concurrency. The ""use cases we show are in the context of long conversations, but version ""checking also has the benefit of preventing lost updates in single database ""transactions."msgstr """El único enfoque que es consistente con alta concurrencia y alta ""escalabilidad es el control optimista de concurrencia con versionamiento. El ""chuequeo de versión usa números de versión, o timestamps, para detectar ""actualizaciones en conflicto (y para prevenir actualizaciones perdidas). ""Hibernate provee para tres enfoques posibles de escribir código de ""aplicación que use concurrencia optimista. Los casos de uso que hemos ""mostrado están en el contexto de transacciones de aplicación largas pero el ""chequeo de versiones tiene además el beneficio de prevenir actualizaciones ""perdidas en transacciones de base de datos solas."#. Tag: title#: transactions.xml:639#, no-c-formatmsgid "Application version checking"msgstr "Chequeo de versiones de aplicación"#. Tag: para#: transactions.xml:641#, no-c-formatmsgid """In an implementation without much help from Hibernate, each interaction with ""the database occurs in a new <literal>Session</literal> and the developer is ""responsible for reloading all persistent instances from the database before ""manipulating them. This approach forces the application to carry out its own ""version checking to ensure conversation transaction isolation. This approach ""is the least efficient in terms of database access. It is the approach most ""similar to entity EJBs."msgstr """En una implementación sin mucha ayuda de Hibernate, cada interacción con la ""base de datos ocurre en una nueva <literal>Session</literal> y el ""desarrollador es 

⌨️ 快捷键说明

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