[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1629?page=c...
]
Nicklas Nordborg commented on HHH-1629:
---------------------------------------
It now works with Postgres but it is broken with MySQL instead. The debug output is more
or less the same as before:
09:02:58,220 INFO DatabaseMetadata:95 - table not found: AnnotationSets
.....and so on for all other tables.
09:02:58,506 DEBUG SchemaUpdate:149 - create table `AnnotationSets` (`id` integer not null
auto_increment, `version` integer not null, `item_type` integer not null, primary key
(`id`)) type=InnoDB
09:02:58,513 ERROR SchemaUpdate:155 - Unsuccessful: create table `AnnotationSets` (`id`
integer not null auto_increment, `version` integer not null, `item_type` integer not null,
primary key (`id`)) type=InnoDB
I also had another problem. At first I got the following stacktrace when starting up and
creating a Session:
java.lang.IllegalArgumentException: interface org.hibernate.jdbc.ConnectionWrapper is not
visible from class loader
at java.lang.reflect.Proxy.getProxyClass(Proxy.java:353)
at java.lang.reflect.Proxy.newProxyInstance(Proxy.java:581)
at
org.hibernate.jdbc.BorrowedConnectionProxy.generateProxy(BorrowedConnectionProxy.java:56)
at
org.hibernate.jdbc.ConnectionManager.borrowConnection(ConnectionManager.java:163)
at org.hibernate.jdbc.JDBCContext.borrowConnection(JDBCContext.java:111)
at org.hibernate.impl.SessionImpl.connection(SessionImpl.java:359)
at net.sf.basedb.core.HibernateUtil.newSession(HibernateUtil.java:790)
at net.sf.basedb.core.HibernateUtil.isEmptyDatabase(HibernateUtil.java:469)
at net.sf.basedb.core.HibernateUtil.createStaticTables(HibernateUtil.java:433)
at net.sf.basedb.core.Install.createTables(Install.java:127)
at net.sf.basedb.install.InitDB.main(InitDB.java:64)
I had to remove ConnectionWrapper.class from the PROXY_INTERFACES array in
org.hibernate.jdbc.BorrowedConnectionProxy class. Line 790 in my HibernateUtil class
contains a call to Session.connection().
SchemaUpdate/validator doesn't listen to quoting
------------------------------------------------
Key: HHH-1629
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-1629
Project: Hibernate3
Type: Bug
Versions: 3.1.2
Environment: Hibernate 3.1.2
Postgres 8.0.4
Linux
Reporter: Nicklas Nordborg
Priority: Trivial
Fix For: 3.2.1
Attachments: AffyFeatureData.hbm.xml, patch-HHH-1629.txt
The SchemaUpdate only generates SQL with CREATE TABLE statements and can't update
existing tables.
With debugging turned on the SchemaUpdate reports:
11:25:22,599 INFO SchemaUpdate:114 - Running hbm2ddl schema update
11:25:22,599 INFO SchemaUpdate:126 - fetching database metadata
.11:25:22,771 INFO SchemaUpdate:142 - updating schema
11:25:22,803 INFO DatabaseMetadata:91 - table not found: AffyFeatures
11:25:22,830 INFO DatabaseMetadata:91 - table not found: AnnotationSets
11:25:22,855 INFO DatabaseMetadata:91 - table not found: AnnotationTypeItems
.... and so on for another 100+ tables
All tables except two exists in the database. The two new tables are created successfully
by SchemaUpdate.
I attach one of my mapping files (generated by XDoclet).
I had a quick look at the SchemaUpdate code (which calls DatabaseMetadata) and I think
the problem is that it converts the table names to upper or lower case, even though I have
quoted them in the mapping files. If the DatabaseMetadata.getTableMetadata could take a
Table object as a parameter instead of the name, schema and catalog, it could check the
Table.isQuoted() method before converting any names to upper or lower case. It seems like
this method is only used by the Configuration class so it shouldn't be too hard to
fix.
I could do the fix myself, but I will only be able to validate it against Postgres and
MySQL using quoted table names. So, others would probably have to validate it agains other
databases and using unquoted table names.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira