📄 best_practices.po
字号:
"or even by changing the order of queries and other operations within a ""particular transaction."msgstr """De tempos em tempos a sessão sincroniza seu estado persistente com o banco ""de dados. O desempenho será afetado se este processo ocorrer frequentemente. ""Você pode algumas vezes minimizar o fluxo desnecessário desabilitando o ""fluxo automático ou até mesmo mudando a ordem das consultas e outras ""operações em uma transação particular."#. Tag: term#: best_practices.xml:121#, no-c-formatmsgid "In a three tiered architecture, consider using detached objects."msgstr """Em uma arquitetura de três camadas, considere o uso de objetos separados."#. Tag: para#: best_practices.xml:123#, no-c-formatmsgid """When using a servlet / session bean architecture, you could pass persistent ""objects loaded in the session bean to and from the servlet / JSP layer. Use ""a new session to service each request. Use <literal>Session.merge()</""literal> or <literal>Session.saveOrUpdate()</literal> to synchronize objects ""with the database."msgstr """When using a servlet / session bean architecture, you could pass persistent ""objects loaded in the session bean to and from the servlet / JSP layer. Use ""a new session to service each request. Use <literal>Session.merge()</""literal> or <literal>Session.saveOrUpdate()</literal> to synchronize objects ""with the database."#. Tag: term#: best_practices.xml:132#, no-c-formatmsgid "In a two tiered architecture, consider using long persistence contexts."msgstr """In a two tiered architecture, consider using long persistence contexts."#. Tag: para#: best_practices.xml:134#, no-c-formatmsgid """Database Transactions have to be as short as possible for best scalability. ""However, it is often neccessary to implement long running ""<emphasis>application transactions</emphasis>, a single unit-of-work from ""the point of view of a user. An application transaction might span several ""client request/response cycles. It is common to use detached objects to ""implement application transactions. An alternative, extremely appropriate in ""two tiered architecture, is to maintain a single open persistence contact ""(session) for the whole life cycle of the application transaction and simply ""disconnect from the JDBC connection at the end of each request and reconnect ""at the beginning of the subsequent request. Never share a single session ""across more than one application transaction, or you will be working with ""stale data."msgstr """Database Transactions have to be as short as possible for best scalability. ""However, it is often necessary to implement long running ""<emphasis>application transactions</emphasis>, a single unit-of-work from ""the point of view of a user. An application transaction might span several ""client request/response cycles. It is common to use detached objects to ""implement application transactions. An alternative, extremely appropriate in ""two tiered architecture, is to maintain a single open persistence contact ""(session) for the whole life cycle of the application transaction and simply ""disconnect from the JDBC connection at the end of each request and reconnect ""at the beginning of the subsequent request. Never share a single session ""across more than one application transaction, or you will be working with ""stale data."#. Tag: term#: best_practices.xml:148#, no-c-formatmsgid "Don't treat exceptions as recoverable."msgstr "Don't treat exceptions as recoverable."#. Tag: para#: best_practices.xml:150#, no-c-formatmsgid """This is more of a necessary practice than a \"best\" practice. When an ""exception occurs, roll back the <literal>Transaction</literal> and close the ""<literal>Session</literal>. If you don't, Hibernate can't guarantee that in-""memory state accurately represents persistent state. As a special case of ""this, do not use <literal>Session.load()</literal> to determine if an ""instance with the given identifier exists on the database; use ""<literal>Session.get()</literal> or a query instead."msgstr """This is more of a necessary practice than a \"best\" practice. When an ""exception occurs, roll back the <literal>Transaction</literal> and close the ""<literal>Session</literal>. If you don't, Hibernate can't guarantee that in-""memory state accurately represents persistent state. As a special case of ""this, do not use <literal>Session.load()</literal> to determine if an ""instance with the given identifier exists on the database; use ""<literal>Session.get()</literal> or a query instead."#. Tag: term#: best_practices.xml:160#, no-c-formatmsgid "Prefer lazy fetching for associations."msgstr "Prefer lazy fetching for associations."#. Tag: para#: best_practices.xml:162#, no-c-formatmsgid """Use eager fetching sparingly. Use proxies and lazy collections for most ""associations to classes that are not likely to be completely held in the ""second-level cache. For associations to cached classes, where there is an a ""extremely high probability of a cache hit, explicitly disable eager fetching ""using <literal>lazy=\"false\"</literal>. When an join fetching is ""appropriate to a particular use case, use a query with a <literal>left join ""fetch</literal>."msgstr """Use eager fetching sparingly. Use proxies and lazy collections for most ""associations to classes that are not likely to be completely held in the ""second-level cache. For associations to cached classes, where there is an a ""extremely high probability of a cache hit, explicitly disable eager fetching ""using <literal>lazy=\"false\"</literal>. When an join fetching is ""appropriate to a particular use case, use a query with a <literal>left join ""fetch</literal>."#. Tag: term#: best_practices.xml:172#, no-c-formatmsgid """Use the <emphasis>open session in view</emphasis> pattern, or a disciplined ""<emphasis>assembly phase</emphasis> to avoid problems with unfetched data."msgstr """Use the <emphasis>open session in view</emphasis> pattern, or a disciplined ""<emphasis>assembly phase</emphasis> to avoid problems with unfetched data."#. Tag: para#: best_practices.xml:177#, no-c-formatmsgid """Hibernate frees the developer from writing tedious <emphasis>Data Transfer ""Objects</emphasis> (DTO). In a traditional EJB architecture, DTOs serve dual ""purposes: first, they work around the problem that entity beans are not ""serializable; second, they implicitly define an assembly phase where all ""data to be used by the view is fetched and marshalled into the DTOs before ""returning control to the presentation tier. Hibernate eliminates the first ""purpose. However, you will still need an assembly phase (think of your ""business methods as having a strict contract with the presentation tier ""about what data is available in the detached objects) unless you are ""prepared to hold the persistence context (the session) open across the view ""rendering process. This is not a limitation of Hibernate! It is a ""fundamental requirement of safe transactional data access."msgstr """Hibernate frees the developer from writing tedious <emphasis>Data Transfer ""Objects</emphasis> (DTO). In a traditional EJB architecture, DTOs serve dual ""purposes: first, they work around the problem that entity beans are not ""serializable; second, they implicitly define an assembly phase where all ""data to be used by the view is fetched and marshalled into the DTOs before ""returning control to the presentation tier. Hibernate eliminates the first ""purpose. However, you will still need an assembly phase (think of your ""business methods as having a strict contract with the presentation tier ""about what data is available in the detached objects) unless you are ""prepared to hold the persistence context (the session) open across the view ""rendering process. This is not a limitation of Hibernate! It is a ""fundamental requirement of safe transactional data access."#. Tag: term#: best_practices.xml:191#, no-c-formatmsgid "Consider abstracting your business logic from Hibernate."msgstr "Consider abstracting your business logic from Hibernate."#. Tag: para#: best_practices.xml:193#, no-c-formatmsgid """Hide (Hibernate) data-access code behind an interface. Combine the ""<emphasis>DAO</emphasis> and <emphasis>Thread Local Session</emphasis> ""patterns. You can even have some classes persisted by handcoded JDBC, ""associated to Hibernate via a <literal>UserType</literal>. (This advice is ""intended for \"sufficiently large\" applications; it is not appropriate for ""an application with five tables!)"msgstr """Hide (Hibernate) data-access code behind an interface. Combine the ""<emphasis>DAO</emphasis> and <emphasis>Thread Local Session</emphasis> ""patterns. You can even have some classes persisted by handcoded JDBC, ""associated to Hibernate via a <literal>UserType</literal>. (This advice is ""intended for \"sufficiently large\" applications; it is not appropriate for ""an application with five tables!)"#. Tag: term#: best_practices.xml:203#, no-c-formatmsgid "Don't use exotic association mappings."msgstr "Don't use exotic association mappings."#. Tag: para#: best_practices.xml:205#, no-c-formatmsgid """Good usecases for a real many-to-many associations are rare. Most of the ""time you need additional information stored in the \"link table\". In this ""case, it is much better to use two one-to-many associations to an ""intermediate link class. In fact, we think that most associations are one-to-""many and many-to-one, you should be careful when using any other association ""style and ask yourself if it is really neccessary."msgstr """Good usecases for a real many-to-many associations are rare. Most of the ""time you need additional information stored in the \"link table\". In this ""case, it is much better to use two one-to-many associations to an ""intermediate link class. In fact, we think that most associations are one-to-""many and many-to-one, you should be careful when using any other association ""style and ask yourself if it is really neccessary."#. Tag: term#: best_practices.xml:215#, no-c-formatmsgid "Prefer bidirectional associations."msgstr "Prefer bidirectional associations."#. Tag: para#: best_practices.xml:217#, no-c-formatmsgid """Unidirectional associations are more difficult to query. In a large ""application, almost all associations must be navigable in both directions in ""queries."msgstr """Unidirectional associations are more difficult to query. In a large ""application, almost all associations must be navigable in both directions in ""queries."
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -