Using Jboss 3.2.6
I've successfully deployed a single .har file:
example1.har
-Channel.hbm.xml
-Channel.class
-META-INF
--hibernate-service.xml
hibernate-service.xml:
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=HibernateExample1">
<attribute name="DatasourceName">java:/jdbc/example1DS</attribute>
<attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.HSQLDialect</attribute>
<attribute name="CacheProviderClass">net.sf.hibernate.cache.HashtableCacheProvider</attribute>
<attribute name="ShowSqlEnabled">false</attribute>
</mbean>
I'd like to access a different set of tables via a different datasource with a 2nd .har file. Configured much like the 1st, but with a different mbean name, and datasource:
example2.har
-Distribution.hbm.xml
-Distribution.class
-META-INF
--hibernate-service.xml
hibernate-service.xml:
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=HibernateExample2">
<attribute name="DatasourceName">java:/jdbc/example2DS</attribute>
<attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.HSQLDialect</attribute>
<attribute name="CacheProviderClass">net.sf.hibernate.cache.HashtableCacheProvider</attribute>
<attribute name="ShowSqlEnabled">false</attribute>
</mbean>
I deployed the 2nd .har and, when I run a query, I get a message:
"net.sf.hibernate.QueryException: unexpected token: as [select v from Distribution as v]
If I remove the 1st .har file and restart the server, the query works.
If I then hot deploy the 1st .har file, the 2nd .har queries work, but the 1st .har file's fail with the same sort of message.
What's the trick to configuring/using two hibernate services?