-->
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: Impact of Code change in database migration MySql to Oracle.
PostPosted: Thu Feb 04, 2010 2:35 pm 
Newbie

Joined: Thu Feb 04, 2010 2:30 pm
Posts: 3
I am migrating the database from MySQL to Oracle. Can anyone please tell me what will be the impact of the changes on the java side. Will it be as simple as changing the configuration in the xml file or will it be something more than that.
The application uses Hibernate.


Top
 Profile  
 
 Post subject: Re: Impact of Code change in database migration MySql to Oracle.
PostPosted: Thu Feb 04, 2010 3:21 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
It depends on your application and data. We are using MySQL. When Oracle released a free developers version a few years ago we decided to test it just for fun. It didn't work out of the box, but none of the problems could be blamed on Hibernate. Below are a few of the problems we discovered. I am not 100% sure which version of Oracle we tested, but I think it was 10g express edition. I have no idea if the problems are still there in the latest Oracle version.

    * Oracle convert emtpy strings to null. This was a problem in a case were we tried to insert an empty string to a column that was "NOT NULL".
    * SELECT DISTINCT fails if there are CLOB column in the select statment. HQL queries that use Query.list()/Query.scroll() need to use Query.iterate() instead.
    * We had an issue with a table name that was too long. It seemed like Oracle could not have names longer than 30 characters.
    * In some places we bypassed Hibernate/HQL and used SQL with LEFT JOIN, etc. This didn't work in Oracle which needed theta-style joins instead.

We got as far as designing a few ideas for how to solve most of the problems, but in the end we decided to drop Oracle since it was just a side-track and no one had asked us to support Oracle in the first place.

So, I guess it is hard to say what problems you will encounter. The only way to know is to try it and see what happens. We had a bunch of test programs that we found very useful.


Top
 Profile  
 
 Post subject: Re: Impact of Code change in database migration MySql to Oracle.
PostPosted: Thu Feb 04, 2010 3:36 pm 
Newbie

Joined: Thu Feb 04, 2010 2:30 pm
Posts: 3
Database migration is not my job. My job is only to see the impact on the Java code.
But did you make any kind of changes to the Hibernate code.
1) If there are no custom SQL statements and comands being used.
2) We will be using Oracle 10g.
3) Can you please share those test programs with me.


Top
 Profile  
 
 Post subject: Re: Impact of Code change in database migration MySql to Oracle.
PostPosted: Thu Feb 04, 2010 5:56 pm 
Expert
Expert

Joined: Wed Mar 03, 2004 6:35 am
Posts: 1240
Location: Lund, Sweden
Solutions for the things I listed all affect the java code in one way or another. We were not migrating an existing database. It was all just about being able to install our application and use Oracle instead of MySQL as the backend database. Another constraint we had was that any changes to the code must still work with MySQL (and PostgreSQL). One such fix would have been to find places that could be affected by NullPointerException:s due to the need to use null instead of empty strings.

The test programs I used are testing our application API and it is not likely they are so useful in your case. They will not help you to find the parts in your code that needs to be changed. The full information we collected about the investigations we made can be found at http://base.thep.lu.se/ticket/413. This is by no means a complete list of problems. I am sure we would have found more issues if we had continued with more thorough investigations. But in the end we decided to not fix anything. Mainly because there was no demand for using Oracle among the users of our application. All in all we spent maybe two days with this.

Our application is a GPL open source application so you are of course always welcome to download it: http://base.thep.lu.se


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.