Hi,
I'm just starting with Hibernate. I'm trying to run the tutorial at
http://www.hibernate.org/hib_docs/onlin ... tion/html/
This is on RH Linux, java 1.4.0.
I'm trying to generate the mapping code from the supplied database, using
ant bottomup.middlegen
I get this error message:
BUILD FAILED
/home/mike/hibernate/build.xml:130: middlegen.MiddlegenException: Couldn't connect to database: The database is already in use by another process: org.hsqldb.NIOLockFile@b07e2b6[file =/home/mike/hibernate/database/toolset.db.lck, exists=true, locked=false, valid=false, fl =null]: java.io.IOException: Invalid argument
okay, so there's a lock file on the db. I delete it and try again, and the same message appears. Somewhere in the ant build script that lock file is getting created and prevents it from going further.
So instead I edit the build.xml file, change the db.url and jdbc class to use my mySql database, and I try again. This time I get the error:
[middlegen] No <table> elements specified. Reading all tables. This might take a while...
[middlegen] (middlegen.MiddlegenPopulator 261 ) 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.
Now, I'm pretty sure that the mysql driver supports metadata. I haven't defined any foreign key relationships in my db. Is that the problem? Why can't hibernate then just build mappings for the isolated tables?
thanks
Michael