-->
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.  [ 12 posts ] 
Author Message
 Post subject: Q: Middlegen finds no relations of mysql 3.23. schemas, why?
PostPosted: Thu Sep 22, 2005 4:18 am 
Beginner
Beginner

Joined: Sun Sep 04, 2005 3:10 am
Posts: 24
Location: CH
I was trying to use middlegen to extract metadata from mysql (version 3.23.58) schemas. Middlegen displays the schemas without relations. it complains like following:
Code:
[middlegen.MiddlegenPopulator] WARNING: Middlegen couldn't find any relations between any tables. This may be intentional from the design of the database, but it may also be because you have incorrectly defined the relationships. It could also be because the JDBC driver you're
using doesn't correctly implement DatabaseMetaData. See the samples (for an example on how to define relationships) and verify that your driver correctly implements DatabaseMetaData.


I have tried the latest JDBC driver connector/J 3.1. So I can exclude the hint given by middlegen. Is it because mysql 3.23 is not able to use the DDL
Code:
foreignkey
"command", i.e. no automatic management of foreign keys os gi. From what does Middlegen derive the relation information? Has anybody a clue why I do not get the relations displayed?
Thanks for any hint
:-)
chk


Top
 Profile  
 
 Post subject:
PostPosted: Thu Sep 22, 2005 9:00 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Middlegen uses the meta data supplied by the JDBC driver. You can code a simple example to test it. I have found that MySQL tends to have variable levels of quaility in the various driver implementations. You just need to find the right driver for it. There are some hints on the Middlegen home page on database issues that have been found.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 24, 2005 4:53 pm 
Beginner
Beginner

Joined: Sun Sep 04, 2005 3:10 am
Posts: 24
Location: CH
david wrote:
Middlegen uses the meta data supplied by the JDBC driver. You can code a simple example to test it. I have found that MySQL tends to have variable levels of quaility in the various driver implementations. You just need to find the right driver for it. There are some hints on the Middlegen home page on database issues that have been found.


Thanks it helped. You were right. I could find sth. on this topic:
http://sourceforge.net/mailarchive/message.php?msg_id=9877368

But not in the way I would have liked it. mySQL 3.x does not work with foreign keys in its DDL. :-(
So, it seems I cannot use this tool.
:-(

Thanks again,
chk


Top
 Profile  
 
 Post subject:
PostPosted: Sat Sep 24, 2005 6:46 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
You can use the tool - I have had it working in the past. I only have 4.x installed at the moment.

In anycase, the Middlegen site has some helpful information,
http://boss.bekk.no/boss/middlegen/platforms/database.html

eg,
Quote:
Requires MySQL 3.23.43b (or higher) with InnoDB enabled and MM.MySQL 2.0.9 or higher. The table names must be define in lower case, otherwise no relations will be discovered. If you have relations using foreign keys that consist of multiple columns, you should use the driver shipped with Middlegen. It has a bugfix which isn't yet fixed in the official driver.

On Win32 with MySQL 4.0.18 (or higher) + JDBC 3.0.14 (or higher), set lower_case_table_names=2 in my.ini. This will force InnoDB tables to be stored in lower-case, and will solve the above problem with relations discovery. The tables can still be referred to my their upper/proper case names, but will be converted to lower-case during the query. Not tested, but expect that lower_case_table_names to either 1 or 2 on Linux will have similar results.

Tested multi-column FKs with MySQL 4.0.20 and JDBC 3.0.14, and multi-column FKs appeared to work.


Hope this helps.


Top
 Profile  
 
 Post subject: Thanks again
PostPosted: Mon Sep 26, 2005 5:06 pm 
Beginner
Beginner

Joined: Sun Sep 04, 2005 3:10 am
Posts: 24
Location: CH
Hi David,
thanks for delivering more information. I was wrong saying that mysql 3.x had no
Code:
foreign key
. The very late 3.23.4x had introduced it. I run mysql 3.28.53 and I had started to migrate my tables from MyISAM to InnoDB. And still Middlegen reports the same Warning all over again. Man, I am pi...ed. It was good to hear from you in this situation.
I just had tried with mm.mysql 2.0.14 JDBC driver again. Did not help.
:-(((
You wrote sth. about the middlegen driver. I am using middlegen 2.1 But I could not find the JDBC driver. Can you help me out another time?
:-)

Thanks, chk


Top
 Profile  
 
 Post subject:
PostPosted: Mon Sep 26, 2005 9:19 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Early version of Middlegen came with a modified JDBC driver. I would have to have a look see to find the download package. You could look on source forge first and download an earlier release. We dropped including it because later drivers were working. Drop me a note if you cannot find it and I will have a look around my Hard drive for it.


Top
 Profile  
 
 Post subject: Sad story continuous
PostPosted: Tue Sep 27, 2005 5:09 am 
Beginner
Beginner

Joined: Sun Sep 04, 2005 3:10 am
Posts: 24
Location: CH
Hi David,
thanks for your support. I just have downloaded middlegen V.1.0 which contains mm.mysql-2.0.9-bin.jar. But this worked not either.
:-(
After reading on the middlegen webpage, I would suspect that it has sth. todo with the mysql v. (3.23.58) I am using. I even have set the variable
lower_case_table_names in the my.ini as said to be necessary for mysql 4.sth

What I will do next is either to install mysql 4 or trying another (middlegen generated sample schema) in mysql 3.23.58 to countercheck.

Thanks again for staying tuned.

Regards, chk


Top
 Profile  
 
 Post subject: Any suggestions from mysql 4.1 and middlegen users
PostPosted: Fri Oct 07, 2005 10:15 am 
Beginner
Beginner

Joined: Sun Sep 04, 2005 3:10 am
Posts: 24
Location: CH
Just wanted to give a reply that I move to mysql 4.1.
But now I have trouble with middlegen which is not able to connect to the DB. It claims that no db server on standard port is running. But it does.

Any suggestions from mysql 4.1 and middlegen users?

Greets, chk


Top
 Profile  
 
 Post subject:
PostPosted: Sun Oct 09, 2005 8:03 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
I have MySQL which I am using for a small project I am working on right now. Its working fine for hibernate so I see no reason why Middlegen will not work with it. I have tried in the past and it was OK. This is going to be a crazy week for this project but I will see if I can get Middlegen to connect. Its like to be a JDBC configuration issue....but you never know :-)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 2:44 pm 
Beginner
Beginner

Joined: Sun Sep 04, 2005 3:10 am
Posts: 24
Location: CH
david wrote:
I have MySQL which I am using for a small project I am working on right now. Its working fine for hibernate so I see no reason why Middlegen will not work with it. I have tried in the past and it was OK. This is going to be a crazy week for this project but I will see if I can get Middlegen to connect. Its like to be a JDBC configuration issue....but you never know :-)


Hi David,
thanks that you still can care about my problem though your in a crazy week. I would be very happy to be able to proceed with my hibernate experiments.
:-)

Regards, chk


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 3:09 pm 
Beginner
Beginner

Joined: Sun Sep 04, 2005 3:10 am
Posts: 24
Location: CH
Thanks David,
You were right. It is a driver problem. I have tried mysql 4.1 but I had used mysql driver 2.14. But in combination with the latest mysql connectorJ 3.1 driver, it works and middlegen even displays relations.
:-))

So what have we learned until now.
In combination with mysql 4.1, middlegen needs an appropriate jdbc driver.

As next I will to try to get all the required foreign implemented, then I will go back to mysql 3.23.58 to see whether middlegen can cope with it. I will test different mysql drivers too.

Regards, chk

PS: let's where I end up next .... ;-)


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 10, 2005 5:38 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 7:19 pm
Posts: 2364
Location: Brisbane, Australia
Great - JDBC driver quality have been a common (and surprising) issue for MySQL. Glad you were able to get a working combination.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 12 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.