📄 performance.po
字号:
#, fuzzymsgid ""msgstr """PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n""Last-Translator: FULL NAME <EMAIL@ADDRESS>\n""Content-Type: text/plain; charset=utf-8\n"#: index.docbook:5msgid "Improving performance"msgstr "Mejorando el rendimiento"#: index.docbook:8msgid "Fetching strategies"msgstr "Estrategias de recuperación"#: index.docbook:10msgid """A <emphasis>fetching strategy</emphasis> is the strategy Hibernate will use ""for retrieving associated objects if the application needs to navigate the ""association. Fetch strategies may be declared in the O/R mapping metadata, ""or over-ridden by a particular HQL or <literal>Criteria</literal> query."msgstr """Una <emphasis>estrategia de recuperación</emphasis> es la estrategia ""que usará Hibernate para recuperar los objetos asociados cuando la ""aplicación necesite navegar la asociación. Las estrategias de ""recuperación pueden ser declaradas en los metadatos de mapeo O/R, o ""sobrescritas por una consulta HQL o <literal>Criteria</literal> en ""particular."#: index.docbook:17msgid "Hibernate3 defines the following fetching strategies:"msgstr "Hibernate3 define las siguientes estrategias de recuperación:"#: index.docbook:23msgid """<emphasis>Join fetching</emphasis> - Hibernate retrieves the associated ""instance or collection in the same <literal>SELECT</literal>, using an ""<literal>OUTER JOIN</literal>."msgstr """<emphasis>Recuperación por unión (join fetching)</emphasis> - ""Hibernate recupera la instancia asociada o colección en la misma ""<literal>SELECT</literal>, usando una <literal>OUTER JOIN</literal>."#: index.docbook:30msgid """<emphasis>Select fetching</emphasis> - a second <literal>SELECT</literal> is ""used to retrieve the associated entity or collection. Unless you explicitly ""disable lazy fetching by specifying <literal>lazy=\"false\"</literal>, this ""second select will only be executed when you actually access the association."msgstr """<emphasis>Recuperación por selección (select fetching)</""emphasis> - se usa una segunda <literal>SELECT</literal> para recuperar la ""entidad asociada o colección. A menos que deshabilites explí""citamente la recuperación perezosa especificando <literal>lazy=\"false""\"</literal>, la segunda selección sólo será ejecutada ""cuando realmente accedas a la asociación."#: index.docbook:39msgid """<emphasis>Subselect fetching</emphasis> - a second <literal>SELECT</literal> ""is used to retrieve the associated collections for all entities retrieved in ""a previous query or fetch. Unless you explicitly disable lazy fetching by ""specifying <literal>lazy=\"false\"</literal>, this second select will only ""be executed when you actually access the association."msgstr """<emphasis>Recuperación por subselección (subselect fetching)</""emphasis> - se usa una segunda <literal>SELECT</literal> para recuperar las ""colecciones asociadas de todas las entidades recuperadas en una consulta o ""recuperación previa. A menos que deshabilites explícitamente ""la recuperación perezosa especificando <literal>lazy=\"false\"</""literal>, esta segunda selección sólo será ejecutada ""cuando realmente accedas a la asociación."#: index.docbook:48msgid """<emphasis>Batch fetching</emphasis> - an optimization strategy for select ""fetching - Hibernate retrieves a batch of entity instances or collections in ""a single <literal>SELECT</literal>, by specifying a list of primary keys or ""foreign keys."msgstr """<emphasis>Recuperación en lote</emphasis> - una estrategia de ""optimización para la recuperación por selección - ""Hibernate recupera un lote de instancias de entidad o colecciones en una ""sola <literal>SELECT</literal>, especificando una lista de claves primarias ""o de claves foráneas."#: index.docbook:57msgid "Hibernate also distinguishes between:"msgstr "Hibernate también distingue entre:"#: index.docbook:63msgid """<emphasis>Immediate fetching</emphasis> - an association, collection or ""attribute is fetched immediately, when the owner is loaded."msgstr """<emphasis>Recuperación inmediata</emphasis> - una asociación, ""colección o atributo es recuperado inmediatamente, cuando el ""dueño es cargado."#: index.docbook:69msgid """<emphasis>Lazy collection fetching</emphasis> - a collection is fetched when ""the application invokes an operation upon that collection. (This is the ""default for collections.)"msgstr """<emphasis>Recuperación perezosa de colecciones</emphasis> - se ""recupera una colección cuando la aplicación invoca una ""operación sobre la colección. (Esto es por defecto para las ""colecciones.)"#: index.docbook:76msgid """<emphasis>\"Extra-lazy\" collection fetching</emphasis> - individual ""elements of the collection are accessed from the database as needed. ""Hibernate tries not to fetch the whole collection into memory unless ""absolutely needed (suitable for very large collections)"msgstr """<emphasis>\"Extra-lazy\" collection fetching</emphasis> - individual ""elements of the collection are accessed from the database as needed. ""Hibernate tries not to fetch the whole collection into memory unless ""absolutely needed (suitable for very large collections)"#: index.docbook:84msgid """<emphasis>Proxy fetching</emphasis> - a single-valued association is fetched ""when a method other than the identifier getter is invoked upon the ""associated object."msgstr """<emphasis>Proxy fetching</emphasis> - a single-valued association is fetched ""when a method other than the identifier getter is invoked upon the ""associated object."#: index.docbook:91msgid """<emphasis>\"No-proxy\" fetching</emphasis> - a single-valued association is ""fetched when the instance variable is accessed. Compared to proxy fetching, ""this approach is less lazy (the association is fetched even when only the ""identifier is accessed) but more transparent, since no proxy is visible to ""the application. This approach requires buildtime bytecode instrumentation ""and is rarely necessary."msgstr """<emphasis>Recuperación por proxy</emphasis> - se recupera una ""asociación monovaluada cuando se invoca un método que no sea ""el getter del identificador sobre el objeto asociado."#: index.docbook:101msgid """<emphasis>Lazy attribute fetching</emphasis> - an attribute or single valued ""association is fetched when the instance variable is accessed. This approach ""requires buildtime bytecode instrumentation and is rarely necessary."msgstr """<emphasis>Recuperación perezosa de atributos</emphasis> - se recupera ""un atributo o una asociación monovaluada cuando se accede a la ""variable de instancia (requiere instrumentación del bytecode en ""tiempo de ejecución). Este enfoque es raramente necesario."#: index.docbook:110msgid """We have two orthogonal notions here: <emphasis>when</emphasis> is the ""association fetched, and <emphasis>how</emphasis> is it fetched (what SQL is ""used). Don't confuse them! We use <literal>fetch</literal> to tune ""performance. We may use <literal>lazy</literal> to define a contract for ""what data is always available in any detached instance of a particular class."msgstr """Aquí tenemos dos nociones ortogonales: <emphasis>cuándo</""emphasis> se recupera la aplicación, y <emphasis>cómo</""emphasis> es recuperada (qué SQL es usado). ¡No las confundas! ""Usamos <literal>fetch</literal> para afinar el rendimiento. Podemos usar ""<literal>lazy</literal> para definir un contrato sobre qué datos ""están siempre disponibles en cualquier instancia separada de una ""clase en particular."#: index.docbook:119msgid "Working with lazy associations"msgstr "Trabajando con asociaciones perezosas"#: index.docbook:121msgid """By default, Hibernate3 uses lazy select fetching for collections and lazy ""proxy fetching for single-valued associations. These defaults make sense for ""almost all associations in almost all applications."msgstr """Por defecto, Hibernate3 usa una recuperación perezosa por ""selección para colecciones y una recuperación por proxy ""perezosa para asociaciones monovaluadas. Estas políticas por defecto ""tienen sentido para casi todas las asociaciones en casi todas las ""aplicaciones."#: index.docbook:127msgid """<emphasis>Note:</emphasis> if you set <literal>hibernate.""default_batch_fetch_size</literal>, Hibernate will use the batch fetch ""optimization for lazy fetching (this optimization may also be enabled at a ""more granular level)."msgstr """<emphasis>Nota:</emphasis> si estableces <literal>hibernate.""default_batch_fetch_size</literal>, Hibernate usará la ""optimización de recuperación en lotes para recuperación ""perezosa (esta optimización también puede ser habilitada a un ""nivel más granularizado)."#: index.docbook:134msgid """However, lazy fetching poses one problem that you must be aware of. Access ""to a lazy association outside of the context of an open Hibernate session ""will result in an exception. For example:"msgstr """Sin embargo, la recuperación perezosa plantea un problema del que ""tienes que estar al tanto. Acceder a una asociación perezosa fuera ""del contexto de una sesión de Hibernate abierta resultará en ""una excepción. Por ejemplo:"#: index.docbook:140msgid """<![CDATA[s = sessions.openSession();\n""Transaction tx = s.beginTransaction();\n"" \n""User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"" .setString(\"userName\", userName).uniqueResult();\n""Map permissions = u.getPermissions();\n""\n""tx.commit();\n""s.close();\n""\n""Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!]]>"msgstr """<![CDATA[s = sessions.openSession();\n""Transaction tx = s.beginTransaction();\n"" \n""User u = (User) s.createQuery(\"from User u where u.name=:userName\")\n"" .setString(\"userName\", userName).uniqueResult();\n""Map permissions = u.getPermissions();\n""\n""tx.commit();\n""s.close();\n""\n""Integer accessLevel = (Integer) permissions.get(\"accounts\"); // Error!]]>"#: index.docbook:142msgid """Since the permissions collection was not initialized when the ""<literal>Session</literal> was closed, the collection will not be able to ""load its state. <emphasis>Hibernate does not support lazy initialization for ""detached objects</emphasis>. The fix is to move the code that reads from the ""collection to just before the transaction is committed."msgstr """Ya que la colección de permisos no fue inicializada cuando se ""cerró la <literal>Session</literal>, la colección no ""será capaz de cargar su estado. <emphasis>Hibernate no soporta la ""inicialización perezosa de objetos separados</emphasis>. La ""solución es mover el código que lee de la colección a ""justo antes que la transacción sea comprometida."#: index.docbook:150msgid """Alternatively, we could use a non-lazy collection or association, by ""specifying <literal>lazy=\"false\"</literal> for the association mapping. ""However, it is intended that lazy initialization be used for almost all ""collections and associations. If you define too many non-lazy associations ""in your object model, Hibernate will end up needing to fetch the entire ""database into memory in every transaction!"msgstr """Alternativamente, podríamos usar una colección no perezosa o ""asociación, especificando <literal>lazy=\"false\"</literal> para el ""mapeo de asociación. Sin embargo, está pensado que la ""inicialización perezosa sea usada para casi todas las colecciones y ""asociaciones. ¡Si defines demasiadas asociaciones no perezosas en tu ""modelo de objetos, Hibernate terminará necesitando recuperar la base ""de datos entera en cada transacción!"#: index.docbook:159msgid """On the other hand, we often want to choose join fetching (which is non-lazy ""by nature) instead of select fetching in a particular transaction. We'll now ""see how to customize the fetching strategy. In Hibernate3, the mechanisms ""for choosing a fetch strategy are identical for single-valued associations ""and collections."msgstr """Por otro lado, frecuentemente necesitamos elegir la recuperación por ""unión (que es no perezosa por naturaleza) en vez de la ""recuperación por selección en una transacción en ""particular. Veremos ahora cómo personalizar la estrategia de ""recuperación. En Hibernate3, los mecanismos para elegir una ""estrategia de recuperación son idénticas a las de las ""asociaciones monovaluadas y colecciones."#: index.docbook:170msgid "Tuning fetch strategies"msgstr "Afinando las estrategias de recuperación"#: index.docbook:172msgid """Select fetching (the default) is extremely vulnerable to N+1 selects ""problems, so we might want to enable join fetching in the mapping document:"msgstr """La recuperación por selección (la preestablecida) es ""extremadamente vulnerable a problemas de selección N+1, de modo ""querríamos habilitar la recuperación por unión (join ""fetching) en el documento de mapeo:"#: index.docbook:177msgid ""
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -