[jboss-jira] [JBoss JIRA] Commented: (JBAS-5015) Deploy entity beans in Oracle 11g on JBoss 4.2.1 and JBoss 4.2.1
Georges Goebel (JIRA)
jira-events at lists.jboss.org
Wed Nov 28 10:07:51 EST 2007
[ http://jira.jboss.com/jira/browse/JBAS-5015?page=comments#action_12389630 ]
Georges Goebel commented on JBAS-5015:
--------------------------------------
Hi,
I have tried to specify the OracleDialect in JBoss to Oracle, ORacle9i or Oracle10g and it never worked because of the problem with the "major version [11]".
I do not use an explicite hibernate configuration in persistence.xml
After replacing the hibernate3,jar in the $JBOSS_HOME/server/default/lib by the one provided by the hibernate 3.2.4sp1 it works.
I don't know exacly if Oracle 11g has new features which require a new ORacleDialect implementation but on my installation with JBoss 4.2.2 and Oracle 11g I have no problems.
Wouldn't it be better to add temporary (until somebody more qualified can confirm) the following line to the "new code" of org.hibernate.dialect.DialectFactory class (use the same implementation on OracleDialect than 10g) because Oracle 11g should be supported out of the box, or not ?:
case 11: // '\n'
return (DialectFactory.class$org$hibernate$dialect$Oracle10gDialect != null ? DialectFactory.class$org$hibernate$dialect$Oracle10gDialect : (DialectFactory.class$org$hibernate$dialect$Oracle10gDialect = DialectFactory._mthclass$("org.hibernate.dialect.Oracle10gDialect"))).getName();
}
> Deploy entity beans in Oracle 11g on JBoss 4.2.1 and JBoss 4.2.1
> ----------------------------------------------------------------
>
> Key: JBAS-5015
> URL: http://jira.jboss.com/jira/browse/JBAS-5015
> Project: JBoss Application Server
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Hibernate service
> Affects Versions: JBossAS-4.2.1.GA, JBossAS-4.2.2.GA
> Environment: JAva 1.5
> JBoss 4.2.1 and JBoss4.2.2
> Reporter: Georges Goebel
> Assigned To: Steve Ebersole
> Priority: Critical
> Fix For: JBossAS-4.2.3.GA
>
>
> It is not possible to deploy entity beans to an Oracle 11g Datasource because the HibernateException :
> unknown Oracle major version [11] occurs
> If I check in the hibernate 3.2.4sp1 distribution the class org.hibernate.dialect.DialectFactory there I find the following definition which is correct (in my eyes)
> private static final Map MAPPERS = new HashMap();
> static {
> // TODO : this is the stuff it'd be nice to move to a properties file or some other easily user-editable place
> MAPPERS.put( "HSQL Database Engine", new VersionInsensitiveMapper( "org.hibernate.dialect.HSQLDialect" ) );
> MAPPERS.put( "DB2/NT", new VersionInsensitiveMapper( "org.hibernate.dialect.DB2Dialect" ) );
> MAPPERS.put( "MySQL", new VersionInsensitiveMapper( "org.hibernate.dialect.MySQLDialect" ) );
> MAPPERS.put( "PostgreSQL", new VersionInsensitiveMapper( "org.hibernate.dialect.PostgreSQLDialect" ) );
> MAPPERS.put( "Microsoft SQL Server Database", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
> MAPPERS.put( "Microsoft SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SQLServerDialect" ) );
> MAPPERS.put( "Sybase SQL Server", new VersionInsensitiveMapper( "org.hibernate.dialect.SybaseDialect" ) );
> MAPPERS.put( "Informix Dynamic Server", new VersionInsensitiveMapper( "org.hibernate.dialect.InformixDialect" ) );
> MAPPERS.put( "Apache Derby", new VersionInsensitiveMapper( "org.hibernate.dialect.DerbyDialect" ) );
>
> MAPPERS.put(
> "Oracle",
> new DatabaseDialectMapper() {
> public String getDialectClass(int majorVersion) {
> return majorVersion > 8
> ? "org.hibernate.dialect.Oracle9Dialect"
> : "org.hibernate.dialect.OracleDialect";
> }
> }
> );
> }
> The JBoss 4.2.2 distribution shows during startup the usage of hibernate 3.2.4sp1 (also according the Manifest file in the jar) but when I decompile the class org.hibernate.dialect.DialectFactory in the JBoss distribution it shows the old implementation:
> static
> {
> MAPPERS = new HashMap();
> MAPPERS.put("HSQL Database Engine", new VersionInsensitiveMapper("org.hibernate.dialect.HSQLDialect"));
> MAPPERS.put("DB2/NT", new VersionInsensitiveMapper("org.hibernate.dialect.DB2Dialect"));
> MAPPERS.put("DB2/LINUX", new VersionInsensitiveMapper("org.hibernate.dialect.DB2Dialect"));
> MAPPERS.put("MySQL", new VersionInsensitiveMapper("org.hibernate.dialect.MySQLDialect"));
> MAPPERS.put("PostgreSQL", new VersionInsensitiveMapper("org.hibernate.dialect.PostgreSQLDialect"));
> MAPPERS.put("Microsoft SQL Server Database", new VersionInsensitiveMapper("org.hibernate.dialect.SQLServerDialect"));
> MAPPERS.put("Microsoft SQL Server", new VersionInsensitiveMapper("org.hibernate.dialect.SQLServerDialect"));
> MAPPERS.put("Sybase SQL Server", new VersionInsensitiveMapper("org.hibernate.dialect.SybaseDialect"));
> MAPPERS.put("Adaptive Server Enterprise", new VersionInsensitiveMapper("org.hibernate.dialect.SybaseDialect"));
> MAPPERS.put("Informix Dynamic Server", new VersionInsensitiveMapper("org.hibernate.dialect.InformixDialect"));
> MAPPERS.put("Apache Derby", new VersionInsensitiveMapper("org.hibernate.dialect.DerbyDialect"));
> MAPPERS.put("Oracle", new DatabaseDialectMapper() {
> public String getDialectClass(int majorVersion)
> {
> switch(majorVersion)
> {
> case 8: // '\b'
> return (DialectFactory.class$org$hibernate$dialect$Oracle8iDialect != null ? DialectFactory.class$org$hibernate$dialect$Oracle8iDialect : (DialectFactory.class$org$hibernate$dialect$Oracle8iDialect = DialectFactory._mthclass$("org.hibernate.dialect.Oracle8iDialect"))).getName();
> case 9: // '\t'
> return (DialectFactory.class$org$hibernate$dialect$Oracle9iDialect != null ? DialectFactory.class$org$hibernate$dialect$Oracle9iDialect : (DialectFactory.class$org$hibernate$dialect$Oracle9iDialect = DialectFactory._mthclass$("org.hibernate.dialect.Oracle9iDialect"))).getName();
> case 10: // '\n'
> return (DialectFactory.class$org$hibernate$dialect$Oracle10gDialect != null ? DialectFactory.class$org$hibernate$dialect$Oracle10gDialect : (DialectFactory.class$org$hibernate$dialect$Oracle10gDialect = DialectFactory._mthclass$("org.hibernate.dialect.Oracle10gDialect"))).getName();
> }
> throw new HibernateException("unknown Oracle major version [" + majorVersion + "]");
> }
> });
> }
> Perhaps there is something wrong by integration the different components in JBoss during packaging.
> Replacing the hibernate3.jar in the JBoss distribution by the hibernate3.jar from the hibernate 3.2.4sp1 distribution solved the problem.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
More information about the jboss-jira
mailing list