Bug 780305 (SOA-2707)

Summary: Documentation needed: dialect auto detection does not work properly for MySQL
Product: [JBoss] JBoss Enterprise SOA Platform 5 Reporter: Jiri Pechanec <jpechane>
Component: Documentation, EDSAssignee: Dana Mison <dmison>
Status: CLOSED NEXTRELEASE QA Contact:
Severity: urgent Docs Contact:
Priority: urgent    
Version: 5.1.0.ER6CC: rhauch, vhalbert
Target Milestone: ---   
Target Release: 5.1.0.CR1   
Hardware: Unspecified   
OS: Unspecified   
URL: http://jira.jboss.org/jira/browse/SOA-2707
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2011-01-18 18:46:25 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Jiri Pechanec 2010-12-21 12:45:35 UTC
Affects: Documentation (Ref Guide, User Guide, etc.), Release Notes
project_key: SOA

See result of the test JdbcConnectionTest for MySQL 5.x

ModeShape requires InnoDB dialect but ordinary MySQL dialect is used.

https://hudson.qa.jboss.com/hudson/view/SOA-Release/job/soa-modeshape-db-openjdk16/9/DATABASE=mysql51,jdk=openjdk-local,label=RHEL5_any/testReport/junit/org.modeshape.connector.store.jpa/JdbcConnectionTest/shouldAutoDetectDialectAndSetOnJpaSource/

I am not sure if this causes any real harm, it may be sufficient to document that automatic detection does not work for MySQL.

Comment 1 Van Halbert 2010-12-21 14:07:43 UTC
Link: Added: This issue Cloned to SOA-2711


Comment 2 Randall Hauch 2010-12-21 17:47:56 UTC
ModeShape simply relies upon Hibernate to do the auto-detection of the dialect, and even Hibernate states that auto-detection will work in most situations (see http://docs.jboss.org/hibernate/core/3.6/reference/en-US/html_single/#portability-dialectresolver).

I suspect that with MySQL, Hibernate is If not, then Hibernate chooses the safest MySQL dialec, which is MySQL 4 MyISAM. Thus, this probably fails on MySQL 5 InnoDB.

So it is probably best to document this in the product. ModeShape will add a note under MODE-1064.

Comment 4 Van Halbert 2011-01-04 15:39:49 UTC
Further investigation is required to determine the real impact of auto-detecting the wrong dialect.

Comment 5 Van Halbert 2011-01-10 18:36:37 UTC
This appears to be a hibernate issue and how/what its auto detecting, not something that ModeShape can control.     We will need to document the issue.

Comment 6 Van Halbert 2011-01-11 14:42:00 UTC
Release Notes Docs Status: Added: Documented as Known Issue
Release Notes Text: Added: Hibernate states that auto-detection will work in most situations.  It will attempt to auto-detect the database dialect, and will choose the safest MySQL dialec, which is MySQL 4 MyISAM.


Comment 7 Van Halbert 2011-01-11 17:45:28 UTC
Release Notes Text: Removed: Hibernate states that auto-detection will work in most situations.  It will attempt to auto-detect the database dialect, and will choose the safest MySQL dialec, which is MySQL 4 MyISAM. Added: If the dialect is not specifically stated for the JPA source in the modeshape-config.xml, then the ModeShape JPA connector will rely on Hibernate and its auto-detection to determine the dialect.   However, in some cases, Hibernate will attempt to auto-detect the database dialect, and will choose the safest MySQL dialect, which is MySQL 4 MyISAM, instead othe MySQL 5 dialect.   To work around the issue where Hibernate selects the wrong dialect, you need to explicitly specify the dialect in the modeshape-config.xml.   By default, the eds-store has the dialect specified.   For differences between MySQL 4 and 5, see http://dev.mysql.com/doc/refman/5.0/en/development-history.html  for the major features between releases.


Comment 8 Randall Hauch 2011-01-11 17:52:15 UTC
Release Notes Text: Removed: If the dialect is not specifically stated for the JPA source in the modeshape-config.xml, then the ModeShape JPA connector will rely on Hibernate and its auto-detection to determine the dialect.   However, in some cases, Hibernate will attempt to auto-detect the database dialect, and will choose the safest MySQL dialect, which is MySQL 4 MyISAM, instead othe MySQL 5 dialect.   To work around the issue where Hibernate selects the wrong dialect, you need to explicitly specify the dialect in the modeshape-config.xml.   By default, the eds-store has the dialect specified.   For differences between MySQL 4 and 5, see http://dev.mysql.com/doc/refman/5.0/en/development-history.html  for the major features between releases. Added: If the dialect is not specifically stated for the JPA source in the modeshape-config.xml, then the ModeShape JPA connector will rely on Hibernate and its auto-detection to determine the dialect. When Hibernate auto-detection is used with MySQL, Hibernate may choose the safest MySQL dialect, which is MySQL 4 MyISAM. Therefore, if your database is using MySQL 5 or MySQL InnoDB, this auto-detection will not be correct. (For differences between MySQL 4 and 5, see http://dev.mysql.com/doc/refman/5.0/en/development-history.html  for the major features between releases.) In this case and any other where auto-detection does not work, simply specify explicitly in the modeshape-config.xml configuration file the correct dialect. By default, the modeshape-config.xml file does specify the dialect for the 'eds-store'. 


Comment 9 Van Halbert 2011-01-18 18:46:25 UTC
Document as a KI.

Comment 10 Dana Mison 2011-02-16 02:05:20 UTC
Writer: Added: Darrin
Release Notes Text: Removed: If the dialect is not specifically stated for the JPA source in the modeshape-config.xml, then the ModeShape JPA connector will rely on Hibernate and its auto-detection to determine the dialect. When Hibernate auto-detection is used with MySQL, Hibernate may choose the safest MySQL dialect, which is MySQL 4 MyISAM. Therefore, if your database is using MySQL 5 or MySQL InnoDB, this auto-detection will not be correct. (For differences between MySQL 4 and 5, see http://dev.mysql.com/doc/refman/5.0/en/development-history.html  for the major features between releases.) In this case and any other where auto-detection does not work, simply specify explicitly in the modeshape-config.xml configuration file the correct dialect. By default, the modeshape-config.xml file does specify the dialect for the 'eds-store'.  Added: If the dialect is not specifically stated for the JPA source in the modeshape-config.xml, then the ModeShape JPA connector relies on Hibernate auto-detection to determine the dialect.  However Hibernate dialect auto-detection does not work reliably with MySQL databases.  When using MySQL, you need to set the correct dialect in the modeshape-config.xml configuration file. By default, the modeshape-config.xml file does specify the dialect for the 'eds-store'.
Affects: Added: [Documentation (Ref Guide, User Guide, etc.), Release Notes]