happytomatoe / hibernate-sqlite

Automatically exported from code.google.com/p/hibernate-sqlite
0 stars 0 forks source link

problem with hbm2dl.auto when setting update #6

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. setting <property name="hbm2ddl.auto">update</property>
2.
3.

What is the expected output? What do you see instead?
I get this error :
5367 [main] INFO  org.hibernate.tool.hbm2ddl.DatabaseMetadata  - table not 
found: NodeImage
5445 [main] DEBUG org.hibernate.util.JDBCExceptionReporter  - could not get 
table metadata: NodeSize [???]
java.sql.SQLException: not yet implemented
        at org.sqlite.MetaData.getImportedKeys(MetaData.java:503)
        at org.hibernate.tool.hbm2ddl.TableMetadata.initForeignKeys(TableMetadata.java:126)
        at org.hibernate.tool.hbm2ddl.TableMetadata.<init>(TableMetadata.java:35)
        at org.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:85)
        at org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:838)
        at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:144)
        at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:295)
        at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1176)

What version of the product are you using? On what operating system?
the latest one with windows 7

Please provide any additional information below.
when i launch my application with this configuration :
setting <property name="hbm2ddl.auto">create</property>
all works fine.
but if i use "update" instead of "create" even if all tables are creates it 
doesn't work. if i use "validate" it works but i can't update my db.

Original issue reported on code.google.com by demoisel...@gmail.com on 19 Nov 2010 at 3:36

GoogleCodeExporter commented 9 years ago
I have the same problem, I'm using ubuntu 10, this is my exception:

org.hibernate.exception.GenericJDBCException: could not get table metadata: 
myTestTable
    at org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:103)
    at org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:91)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:43)
    at org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:29)
    at org.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:105)
    at org.hibernate.cfg.Configuration.generateSchemaUpdateScript(Configuration.java:954)
    at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:140)
    at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:314)
    at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1300)
    at conae.sop.nssb.persistence.PersistenceManager.<init>(PersistenceManager.java:33)
    at conae.sop.nssb.persistence.PersistenceManager.getInstance(PersistenceManager.java:46)
    at conae.sop.nssb.persistence.DataManager.<init>(DataManager.java:32)
    at conae.sop.nssb.srv.mon.NSSBMonitor.<init>(NSSBMonitor.java:43)
    at conae.sop.nssb.Main.startServices(Main.java:86)
    at conae.sop.nssb.Main.main(Main.java:111)
Caused by: java.sql.SQLException: not yet implemented
    at org.sqlite.MetaData.getImportedKeys(MetaData.java:503)
    at org.hibernate.tool.hbm2ddl.TableMetadata.initForeignKeys(TableMetadata.java:118)
    at org.hibernate.tool.hbm2ddl.TableMetadata.<init>(TableMetadata.java:34)
    at org.hibernate.tool.hbm2ddl.DatabaseMetadata.getTableMetadata(DatabaseMetadata.java:90)
    ... 10 more

"hibernate.cfg.xml" ---->>  <property name="hbm2ddl.auto">update</property>

Original comment by fed...@gmail.com on 16 Dec 2010 at 9:07

GoogleCodeExporter commented 9 years ago
Any suggestion for a workaround? The problem persists in hibernate 4. and even 
worse create does not seem to work.

Original comment by slaninac...@gmail.com on 12 Jun 2013 at 8:42