Known issues with MySQL
-
The default table types that MySQL uses do not support transactions, which will prevent OpenJPA from being able to roll back transactions. Use the
InnoDBtable type for any tables that OpenJPA will access. -
MySQL does not support sub-selects in versions prior to 4.1, so some operations (such as the
isEmpty()method in a query) will fail due to this. -
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
rollback()before a transaction has been committed, however, are always supported. -
Floats and doubles may lose precision when stored in some datastores.
-
When storing a field of type
java.math.BigDecimal, some datastores will add extraneous trailing 0 characters, causing an equality mismatch between the field that is stored and the field that is retrieved. -
When using large result sets with MySQL there are a number of documented limitations. Please read the section titled "ResultSet" in the "MySQL JDBC API Implementation Notes". The net effect of these limitations is that you will have to read all of the rows of a result set (or close the connection) before you can issue any other queries on the connection, or an exception will be thrown. Setting openjpa.FetchBatchSize to any value greater than zero will enable streaming result sets.
-
The use of LOB streaming is limited. When reading LOB data from the database, the MySQL JDBC driver will actually load all the data into memory at the same time.
-
As of MySQL 5.7 the
DATETIMEdata type supports sub-second fractions. The default of MySQL is to use no fractions. The number of fractions can be explicitly set via scale:@Column(scale=3)will lead to aDATETIME(3)column. -
MySQL does not support native sequences. If you would like to use generated values with SQL Server you should use GenerationType.IDENTITY, GenerationType.TABLE, or GenerationType.AUTO.