| <html><head> |
| <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> |
| <title>5. Setting the Transaction Isolation</title><link rel="stylesheet" href="css/docbook.css" type="text/css"><base href="display"><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"><link rel="start" href="manual.html" title="Apache OpenJPA 2.1 User's Guide"><link rel="up" href="ref_guide_dbsetup.html" title="Chapter 4. JDBC"><link rel="prev" href="ref_guide_dbsetup_dbsupport.html" title="4. Database Support"><link rel="next" href="ref_guide_dbsetup_sql92.html" title="6. Setting the SQL Join Syntax"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">5. |
| Setting the Transaction Isolation |
| </th></tr><tr><td width="20%" align="left"><a accesskey="p" href="ref_guide_dbsetup_dbsupport.html">Prev</a> </td><th width="60%" align="center">Chapter 4. |
| JDBC |
| </th><td width="20%" align="right"> <a accesskey="n" href="ref_guide_dbsetup_sql92.html">Next</a></td></tr></table><hr></div><div class="section" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="ref_guide_dbsetup_isolation"></a>5. |
| Setting the Transaction Isolation |
| </h2></div></div></div><a class="indexterm" name="d0e23954"></a><a class="indexterm" name="d0e23959"></a><a class="indexterm" name="d0e23964"></a><p> |
| OpenJPA typically retains the default transaction isolation level of the JDBC |
| driver. However, you can specify a transaction isolation level to use through |
| the <a href="ref_guide_conf_jdbc.html#openjpa.jdbc.TransactionIsolation" title="6.18. openjpa.jdbc.TransactionIsolation"><code class="literal"> |
| openjpa.jdbc.TransactionIsolation</code></a> configuration property. The |
| following is a list of standard isolation levels. Note that not all databases |
| support all isolation levels. |
| </p><div class="itemizedlist"><ul type="disc"><li><p> |
| <code class="literal">default</code>: Use the JDBC driver's default isolation level. |
| OpenJPA uses this option if you do not explicitly specify any other. |
| </p></li><li><p> |
| <code class="literal">none</code>: No transaction isolation. |
| </p></li><li><p> |
| <code class="literal">read-committed</code>: Dirty reads are prevented; non-repeatable |
| reads and phantom reads can occur. |
| </p></li><li><p> |
| <code class="literal">read-uncommitted</code>: Dirty reads, non-repeatable reads and |
| phantom reads can occur. |
| </p></li><li><p> |
| <code class="literal">repeatable-read</code>: Dirty reads and non-repeatable reads are |
| prevented; phantom reads can occur. |
| </p></li><li><p> |
| <code class="literal">serializable</code>: Dirty reads, non-repeatable reads, and phantom |
| reads are prevented. |
| </p></li></ul></div><div class="example"><a name="ref_guide_dbsetup_isoex"></a><p class="title"><b>Example 4.8. |
| Specifying a Transaction Isolation |
| </b></p><div class="example-contents"><pre class="programlisting"> |
| <property name="openjpa.jdbc.TransactionIsolation" value="repeatable-read"/> |
| </pre></div></div><br class="example-break"></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="ref_guide_dbsetup_dbsupport.html">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="ref_guide_dbsetup.html">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="ref_guide_dbsetup_sql92.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">4. |
| Database Support |
| </td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top"> 6. |
| Setting the SQL Join Syntax |
| </td></tr></table></div></body></html> |