-->
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.  [ 6 posts ] 
Author Message
 Post subject: hibernate.hbm2ddl.auto = auto not working with SQLite
PostPosted: Sun Apr 10, 2016 9:39 am 
Newbie

Joined: Sun Apr 10, 2016 9:33 am
Posts: 3
I use Hibernate + SQLite and i need to support updating database schema when:
- a) table is added
- b) table is removed
- c) columnd is added
- d) column is removed

My hibernate configuration:

Code:
lConf.setProperty("hibernate.dialect", "app.sqlite.SQLiteDialect");
    lConf.setProperty("hibernate.connection.driver_class", "org.sqlite.JDBC");
    lConf.setProperty("hibernate.hbm2ddl.auto", "update");


I can paste here SQLiteDialect if needed.

My database is not updated when new database entity is added and i the exception occures:

Code:
Caused by: java.util.NoSuchElementException
       at java.util.StringTokenizer.nextToken(Unknown Source)
       at org.hibernate.tool.schema.extract.internal.InformationExtractorJdbcDatabaseMetaDataImpl.getColumn(InformationExtractorJdbcDatabaseMetaDataImpl.java:469)
       at org.hibernate.tool.schema.extract.internal.TableInformationImpl.getColumn(TableInformationImpl.java:68)
       at org.hibernate.mapping.Table.sqlAlterStrings(Table.java:456)
       at org.hibernate.tool.schema.internal.SchemaMigratorImpl.migrateTable(SchemaMigratorImpl.java:254)
       at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigrationToTargets(SchemaMigratorImpl.java:170)
       at org.hibernate.tool.schema.internal.SchemaMigratorImpl.doMigration(SchemaMigratorImpl.java:60)
       at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:133)
       at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:101)
       at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:470)
       at org.hibernate.boot.internal.SessionFactoryBuilderImpl.build(SessionFactoryBuilderImpl.java:444)
       at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:708)
       at app.sqlite.eDocumentsDBConnector.connect(eDocumentsDBConnector.java:69)


Top
 Profile  
 
 Post subject: Re: hibernate.hbm2ddl.auto = auto not working with SQLite
PostPosted: Mon Apr 11, 2016 1:01 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
SQLite is not supported by default. There are plans to supported in the near future.


Top
 Profile  
 
 Post subject: Re: hibernate.hbm2ddl.auto = auto not working with SQLite
PostPosted: Mon Apr 11, 2016 5:30 pm 
Newbie

Joined: Sun Apr 10, 2016 9:33 am
Posts: 3
Could You provide more information when can i expect hibernate SQLite support or maybe is there some kind of workaround to update database (at least those 4 cases). I am not hibernate expert but maybe could you provide any hints which classes need to be implemented to support updates with SQLite (only Dialect?)?
I can use temporarly another database but my production release needs to use SQLite as i cant find any other database that support Multi-User access.

Thank You for help!


Top
 Profile  
 
 Post subject: Re: hibernate.hbm2ddl.auto = auto not working with SQLite
PostPosted: Tue Apr 12, 2016 1:26 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
It has not been decided whether SQLite will be supported, or when it will happen.

What do you mean by "I can't find any other database that supports Multi-User access"?

Every relational database that I used so far supports multiple user accounts.


Top
 Profile  
 
 Post subject: Re: hibernate.hbm2ddl.auto = auto not working with SQLite
PostPosted: Tue Apr 12, 2016 3:11 am 
Newbie

Joined: Sun Apr 10, 2016 9:33 am
Posts: 3
Ok, I didnt add here that i need embedded database as i have desktop application (by supported multi-user i mean multi-user connection and at least SQL SELECT). Do you know any alternatives to SQLite? Or maybe do you know client-server database that is supported by hibernate and can be easly published/autoinstalled with my application on local machine?


Top
 Profile  
 
 Post subject: Re: hibernate.hbm2ddl.auto = auto not working with SQLite
PostPosted: Tue Apr 12, 2016 3:16 am 
Hibernate Team
Hibernate Team

Joined: Thu Sep 11, 2014 2:50 am
Posts: 1628
Location: Romania
There many possibilities:

1. The bets one would be to just embed PostgreSQL.
2. HSQLDB is another option too.
3. H2 is also worth considering too.


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