[jboss-user] [Persistence, JBoss/CMP, Hibernate, Database] - How to setup hibernate-service.xml wihtout Jboss environment

chwang do-not-reply at jboss.com
Mon Oct 20 15:06:56 EDT 2008


Hi Folks,

I can put my hibernate object into a har file, and deployed in the jboss.

in my code, I need to look up "java:/hibernate/SessionFactory"

new InitialContext().lookup("java:/hibernate/SessionFactory");

This name is also matched in hibernate-service.xml file.

I wonder if we don't put my hibernate object into jboss environment. How can i set up this hibernate-service.xml in the test environment?
Please help. Thank you,

Chaohua


This is a hibernate-service.xml file
Code:

Code:

<server>
  |     <mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=Hibernate">
  |         <attribute name="DatasourceName">java:/RewardsDS</attribute>
  |         <attribute name="Dialect">org.hibernate.dialect.SQLServerDialect</attribute>
  |         <attribute name="SessionFactoryName">java:/hibernate/SessionFactory</attribute>
  |         <atttribute name="transaction.manager_lookup_class">
  |             org.hibernate.transaction.JBossTransactionManagerLookup</atttribute>
  |         <attribute name="CacheProviderClass">
  |             org.hibernate.cache.HashtableCacheProvider
  |         </attribute>
  |         <attribute name="QueryCacheEnabled">true</attribute>
  |     </mbean>
  | </server>
  | 	
  | 
  | 
  | 	

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4183332#4183332

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4183332



More information about the jboss-user mailing list