blob: 24cf95a063a59d3a7a7eb84db88569e708e36421 [file] [log] [blame]
<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>14.&nbsp; MySQL</title><link rel="stylesheet" href="css/docbook.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.72.0"><link rel="start" href="manual.html" title="Apache OpenJPA User's Guide"><link rel="up" href="supported_databases.html" title="Appendix&nbsp;2.&nbsp; Supported Databases"><link rel="prev" href="dbsupport_foxpro.html" title="13.&nbsp; Microsoft FoxPro"><link rel="next" href="dbsupport_oracle.html" title="15.&nbsp; Oracle"></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">14.&nbsp;
MySQL
</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="dbsupport_foxpro.html">Prev</a>&nbsp;</td><th width="60%" align="center">Appendix&nbsp;2.&nbsp;
Supported Databases
</th><td width="20%" align="right">&nbsp;<a accesskey="n" href="dbsupport_oracle.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="dbsupport_mysql"></a>14.&nbsp;
MySQL
</h2></div></div></div><div class="toc"><dl><dt><span class="section"><a href="dbsupport_mysql.html#dbsupport_mysql_issues">14.1.
Known issues with MySQL
</a></span></dt></dl></div><div class="example"><a name="example_props_mysql"></a><p class="title"><b>Example&nbsp;2.14.&nbsp;
Example properties for MySQL
</b></p><div class="example-contents"><pre class="programlisting">
openjpa.ConnectionDriverName: com.mysql.jdbc.Driver
openjpa.ConnectionURL: jdbc:mysql://SERVER_NAME/DB_NAME
</pre></div></div><br class="example-break"><div class="section" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="dbsupport_mysql_issues"></a>14.1.&nbsp;
Known issues with MySQL
</h3></div></div></div><div class="itemizedlist"><ul type="disc"><li><p>
The default table types that MySQL uses do not support transactions, which will
prevent OpenJPA from being able to roll back transactions. Use the
<code class="literal">InnoDB</code> table type for any tables that OpenJPA will access.
</p></li><li><p>
MySQL does not support sub-selects in versions prior to 4.1, and are disabled by
default. Some operations (such as the <code class="function">isEmpty()</code> method in a
query) will fail due to this. If you are using MySQL 4.1 or later, you can lift
this restriction by setting the <code class="literal">SupportsSubselect=true</code>
parameter of the <a href="ref_guide_conf_jdbc.html#openjpa.jdbc.DBDictionary" title="6.2.&nbsp; openjpa.jdbc.DBDictionary">
openjpa.jdbc.DBDictionary</a> property.
</p></li><li><p>
Rollback due to database error or optimistic lock violation is not supported
unless the table type is one of the MySQL transactional types. Explicit calls to
<code class="function">rollback()</code> before a transaction has been committed,
however, are always supported.
</p></li><li><p>
Floats and doubles may lose precision when stored in some datastores.
</p></li><li><p>
When storing a field of type <code class="classname">java.math.BigDecimal</code>, some
datastores will add extraneous trailing 0 characters, causing an equality
mismatch between the field that is stored and the field that is retrieved.
</p></li><li><p>
Some version of the MySQL JDBC driver have a bug that prevents OpenJPA from
being able to interrogate the database for foreign keys. Version 3.0.14 (or
higher) of the MySQL driver is required in order to get around this bug.
</p></li></ul></div></div></div><div class="navfooter"><hr><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="dbsupport_foxpro.html">Prev</a>&nbsp;</td><td width="20%" align="center"><a accesskey="u" href="supported_databases.html">Up</a></td><td width="40%" align="right">&nbsp;<a accesskey="n" href="dbsupport_oracle.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">13.&nbsp;
Microsoft FoxPro
&nbsp;</td><td width="20%" align="center"><a accesskey="h" href="manual.html">Home</a></td><td width="40%" align="right" valign="top">&nbsp;15.&nbsp;
Oracle
</td></tr></table></div></body></html>