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.  [ 3 posts ] 
Author Message
 Post subject: Create non-existing databases schemes
PostPosted: Mon Nov 14, 2005 7:13 am 
Newbie

Joined: Thu Jun 23, 2005 5:17 am
Posts: 6
Hi,

I have a question about Hibernate and PostgreSQL concerning the creation of non-existing databases. Does Hibernate automatically create the scheme of a database if not existed on the PostgreSQL-Server? I have set:

- hibernate.hbm2ddl.auto create
- hibernate.hbm2ddl.auto create-drop
- hibernate.hbm2ddl.auto update

but always get:

ERROR - could not get database metadata org.postgresql.util.PSQLException:Backend could not start: FATAL: database "dbname" does not exist.

Or does Hibernate only creates schemes for embedded db-applications?



Greetings...




p.s. this is my hibernate.properties:

show_sql true

transaction.factory_class org.hibernate.transaction.JDBCTransactionFactory

hibernate.cache.provider_class org.hibernate.cache.HashtableCacheProvider

hibernate.dialect org.hibernate.dialect.PostgreSQLDialect
hibernate.connection.driver_class org.postgresql.Driver
hibernate.connection.url jdbc:postgresql://localhost/eventuser_serverclient
hibernate.connection.username postgres
hibernate.connection.password postgres
hibernate.query.substitutions yes 'Y', no 'N'

hibernate.connection.pool_size 2

hibernate.hbm2ddl.auto create
hibernate.hbm2ddl.auto create-drop
hibernate.hbm2ddl.auto update

hibernate.order_updates true

hibernate.max_fetch_depth 1

hibernate.default_batch_fetch_size 8

hibernate.jdbc.batch_versioned_data true

hibernate.jdbc.use_streams_for_binary true

hibernate.cache.region_prefix hibernate.test


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 14, 2005 7:25 am 
Senior
Senior

Joined: Thu Aug 04, 2005 4:54 am
Posts: 153
Location: Birmingham, UK
It creates schemas but the database needs to exist for the schema to be created inside it. Somewhere hibernate is looking for a database called dbname which doesn't exist.

Are you using hibernate.properties and hibernate.cfg.xml for configuration.


Top
 Profile  
 
 Post subject:
PostPosted: Mon Nov 14, 2005 7:43 am 
Newbie

Joined: Thu Jun 23, 2005 5:17 am
Posts: 6
Thank you for replying. I only use hibernate.properties.

Well I see, for server-client-version a database needs to be existed. I just wonder because I did not have that problem using HSQL-embedded or One$-embedded with a non-existing database.



Greetings...


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