-->
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: Specifying multiple drivers
PostPosted: Fri Feb 13, 2009 3:30 pm 
Newbie

Joined: Fri Dec 05, 2008 3:21 pm
Posts: 6
We use Oracle, PostgreSQL and SQL Server in our environment.

It would appear from the documentation that I cannot specify multiple drivers in the various configuration xml files. Only the driver from the configuration file used in the Configuration().configure call gets used. And I don't see a way to specify multiple configuration files.

Correct me if I'm wrong!


Top
 Profile  
 
 Post subject:
PostPosted: Fri Feb 13, 2009 4:24 pm 
Hibernate Team
Hibernate Team

Joined: Fri Oct 05, 2007 4:47 pm
Posts: 2536
Location: Third rock from the Sun
you can have multiple configurations; in each one you configure the connection options to one database / persistence unit / context.
Of course it doesn't make sense to have more than one driver for one connection.
To answer about advanced use cases like transactions across multiple different datasources you will need to describe much more your environment; Usually you will not define the driver in hibernate's configuration but refer to application server defined datasources.
Please post more questions about Hibernate or JPA in the correct forum
at
http://forum.hibernate.org/viewforum.php?f=1

_________________
Sanne
http://in.relation.to/


Top
 Profile  
 
 Post subject:
PostPosted: Mon Feb 23, 2009 5:45 pm 
Newbie

Joined: Fri Dec 05, 2008 3:21 pm
Posts: 6
It may be that I'm confused, but I think this is a Shards issue, which is why I posted it here. With Hibernate you're only going to have a single hibernate.cfg.xml file.

I'm using Shards and I have a hibernate0.cfg.xml and a hibernate1.cfg.xml. The driver_class is different for each (MS SQL Server and PostgreSQL). I've found that it will only use whichever I load first - not both.

Thanks,
Kevin


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.