If using JBoss 3.2.6 you can use a hibernate archive
Here is a sample .har layout
foo.har/
---User.hbm.xml
---Role.hbm.xml
---META-INF/
------hibernate-service.xml
---com/
------foo/
---------model/
------------User.class
------------Role.class
Sample hibernate-service.xml
Code:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE server>
<server>
<mbean code="org.jboss.hibernate.jmx.Hibernate" name="jboss.har:service=fooapp-hibernate">
<depends>jboss.jca:service=RARDeployer</depends>
<!-- so it won't deploy until the datasrouce is available -->
<depends>jboss.jca:service=LocalTxCM,name=fooappDS</depends>
<attribute name="DatasourceName">java:/fooappDS</attribute>
<attribute name="SessionFactoryName">java:/fooapp/hibernate/SessionFactory</attribute>
<attribute name="Dialect">net.sf.hibernate.dialect.MySQLDialect</attribute>
<attribute name="CacheProviderClass">net.sf.ehcache.hibernate.Provider</attribute>
<attribute name="QueryCacheEnabled">true</attribute>
<attribute name="ShowSqlEnabled">true</attribute>
<attribute name="MaxFetchDepth">1</attribute>
</mbean>
</server>
btarbox wrote:
I have read that document, and its great but not complete.
I created the sar and deployed it..and still got 'no connection info found' until I included hibernate.properties.
Using just the sar where can I specify connection properties such as user and password (remember, I want this to work out of the box)?
Thank you.
Brian
Code: