-
1. Re: JBoss and Hibernate - mapping of classes to connections
weston.price Jul 6, 2006 3:10 PM (in response to arnieaustin)This is not really a JCA question, but falls more on the Hibernate side.
However, your hibernate-cfg.xml should appropriate map your entity objects, to your connection configuration. Assuming that you have n databases, you would need n hibernate-cfg.xml files. Each cfg file should have a reference to a datasource for that particular set of entities you want it to be responsible for.
What DB are you using? -
2. Re: JBoss and Hibernate - mapping of classes to connections
arnieaustin Jul 6, 2006 3:31 PM (in response to arnieaustin)Sorry about the wrong forum; Sybase 12.x. I have several dozen hbm.xml files for each entity class, and one hibernate-service.xml file (below). I found an old document (somewhere that showed (maybe in Hibenate 2.x and pre-JBoss AS 4) the various entities linked to a specific connection but trying that generated an error).
The Hibernate engine during configuration, seems to read each hbm.xml file N times - one for each SessionFactory defined below. Seems to be a bit of a waste considering some don't belong on certain ones...?
<?xml version="1.0" encoding="UTF-8"?>
<!-- datasource settings -->
java:/applicationSecurity
org.hibernate.dialect.SybaseDialect
<!-- bind the hibernate service to jndi -->
java:/hibernate/SfApplicationSecurity
org.hibernate.cache.HashtableCacheProvider
<!-- logging -->
true
<!-- datasource settings -->
java:/working
org.hibernate.dialect.SybaseDialect
<!-- bind the hibernate service to jndi -->
java:/hibernate/SfWorking
org.hibernate.cache.HashtableCacheProvider
<!-- logging -->
true
<!-- datasource settings -->
java:/common
org.hibernate.dialect.SybaseDialect
<!-- bind the hibernate service to jndi -->
java:/hibernate/SfCommon
org.hibernate.cache.HashtableCacheProvider
<!-- logging -->
true
<!-- datasource settings -->
java:/employeeWarehouse
org.hibernate.dialect.SybaseDialect
<!-- bind the hibernate service to jndi -->
java:/hibernate/SfEmployeeWarehouse
org.hibernate.cache.HashtableCacheProvider
<!-- logging -->
true -
3. Re: JBoss and Hibernate - mapping of classes to connections
weston.price Jul 6, 2006 3:34 PM (in response to arnieaustin)Again, this is more on the Hibernate side of things. Could you please move your post there?
-
4. Re: JBoss and Hibernate - mapping of classes to connections
arnieaustin Jul 6, 2006 3:37 PM (in response to arnieaustin)If by move it there you are referring to the Hibernate.org site, that isn't an option. They have NO documentation on using it from JBoss as a AS service. Is there a particular forum here for this?