-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Upgrading from 3.3.2 to 3.5.1...
PostPosted: Tue Jun 01, 2010 4:05 pm 
Beginner
Beginner

Joined: Fri Jul 08, 2005 8:55 pm
Posts: 37
Hi

Is there a guide somewhere to update from 3.3. to 3.5?

I've added the dependencies:
hibernate-core.3.5.1-Final.jar
and
javassist-3.9.0.GA.jar

I noticed that Hibernate.STRING and other are deprecated but it does compile ok...

When I run a test that does Schema validation, I now get this:

[junit] Testcase: testSchemaValidation took 14.5 sec
[junit] Caused an ERROR
[junit] No Dialect mapping for JDBC type: -1
[junit] org.hibernate.MappingException: No Dialect mapping for JDBC type: -1
[junit] at org.hibernate.dialect.TypeNames.get(TypeNames.java:79)
[junit] at org.hibernate.dialect.TypeNames.get(TypeNames.java:104)
[junit] at org.hibernate.dialect.Dialect.getTypeName(Dialect.java:347)
[junit] at org.hibernate.mapping.Column.getSqlType(Column.java:208)
[junit] at org.hibernate.mapping.Table.validateColumns(Table.java:280)
[junit] at org.hibernate.cfg.Configuration.validateSchema(Configuration.java:1174)
[junit] at org.hibernate.tool.hbm2ddl.SchemaValidator.validate(SchemaValidator.java:139)
[junit] at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:387)
[junit] at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1385)
[junit] at com.appendium.pf.AbstractTestCase.setUp(AbstractTestCase.java:52)
[junit] at com.appendium.pf.beans.SchemaValidationTest.setUp(SchemaValidationTest.java:22)

Any suggestion? this is new since upgrading...

This seems to be related to using a "text" field (mapped to a String).
This throws the exception <property name="changes" type="text" />

This is ok <property name="changes" type="clob" />
BUT the class is using String for field 'changes', so it does not work at runtime!

Any suggestion? Thanks!

I'm using OracleDialect
My hibernate.cfg.xml is as follows:

Code:
<hibernate-configuration>
    <session-factory name="test">
        <!-- connection and DB details -->
        <!-- Oracle -->
        <property name="dialect">org.hibernate.dialect.OracleDialect</property>
        <property name="connection.url">jdbc:oracle:thin:@//localhost:1521/orcl</property>
        <property name="connection.driver_class">oracle.jdbc.OracleDriver</property>
        <property name="connection.username">XXXXXXXXXX</property>
        <property name="connection.password">XXXXXXXXXX</property>

        <!-- transaction handling -->
        <property name="current_session_context_class">org.hibernate.context.ThreadLocalSessionContext</property>

        <!-- schema validation -->
        <property name="hbm2ddl.auto">validate</property>

        <!-- optimisation -->
        <property name="jdbc.batch_size">32</property>
        <property name="default_batch_fetch_size">8</property>
        <property name="jdbc.fetch_size">2</property>
        <property name="max_fetch_depth">2</property>
        <property name="cglib.use_reflection_optimizer">true</property>

        <!-- logging -->
        <property name="show_sql">true</property>
        <property name="use_sql_comments">true</property>
        <property name="format_sql">true</property>

        <!-- caching -->
        <property name="cache.use_second_level_cache">false</property>
        <property name="cache.provider_class">org.hibernate.cache.HashtableCacheProvider</property>
        <property name="cache.use_query_cache">false</property>

        <!-- mappings ==================================================================== -->
        <mapping resource="hibernate/Accrual.hbm.xml" />
...
    </session-factory>
</hibernate-configuration>


Top
 Profile  
 
 Post subject: Re: Upgrading from 3.3.2 to 3.5.1...
PostPosted: Tue Jun 01, 2010 5:22 pm 
Beginner
Beginner

Joined: Fri Jul 08, 2005 8:55 pm
Posts: 37
A bit more info, since upgrading to 3.5.2

for: <property name="changes" type="text" />

If I use OracleDialect
org.hibernate.MappingException: No Dialect mapping for JDBC type: -1

If I use Oracle9Dialect, Oracle9iDialect or Oracle10gDialect, I get this error:
Wrong column type in ATRIUM.AUDITLOG for column changes. Found: clob, expected: long
org.hibernate.HibernateException: Wrong column type in ATRIUM.AUDITLOG for column changes. Found: clob, expected: long

It seems that I am in a strange situation...

If I use Hibernate 3.3.2 and OracleDialect, everything works fine...
(But I'd like to upgrade!)

In this case, it seems to be able to handle String (in Object) and Clob (in DB) transparantly...

Thanks!
B


Top
 Profile  
 
 Post subject: Re: Upgrading from 3.3.2 to 3.5.1...
PostPosted: Wed Jun 02, 2010 1:15 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 11, 2009 2:26 am
Posts: 29
http://opensource.atlassian.com/project ... e/HHH-3892

and OracleDialect was deprecated along ago :)

sorry we haven't update our docs to reflect this type change, it is on working http://opensource.atlassian.com/project ... e/HHH-4878


Top
 Profile  
 
 Post subject: Re: Upgrading from 3.3.2 to 3.5.1...
PostPosted: Wed Jun 02, 2010 3:57 am 
Beginner
Beginner

Joined: Fri Jul 08, 2005 8:55 pm
Posts: 37
Thanks for the links.

I did try Oracle9iDialect and even Oracle10gDialect; the same problem happens.

From what I read on http://opensource.atlassian.com/project ... e/HHH-3892
This task is complete? I'm using 3.5.1 so it should have it...

But I still see mapping CLOB to Long...

Could anyone point to an article/post that shows step-by-step how to have a long string in Oracle and a java.lang.String in a class?

DB: Should the column be a CLOB?
Class: Should the field be a String
HBM.xml: how should I map the 2?

That would be so useful, as the hibernate documentation said "These types can be inconvenient for some applications"... you don't say...

Thanks a lot

B


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.