Define Hibernate Session and Bind to DataSource

GMProject/hibernate/META-INF/hibernate-service.xml
<server>
	<mbean code="org.jboss.hibernate.jmx.Hibernate"
		name="jboss.har:service=Project1">
		<attribute name="DefaultSchema">Schema1</attribute>
		<attribute name="DatasourceName">java:/GraymoundDS</attribute>
		<attribute name="Dialect">
			org.hibernate.dialect.PostgreSQLDialect
		</attribute>
		<attribute name="SessionFactoryName">
			java:/hibernate/project1/Accounting
		</attribute>
		<attribute name="ShowSqlEnabled">false</attribute>
	</mbean>
</server>
GMDevelopment\JBoss\jboss-4.2.1.GA\server\default\deploy\deploy.last
<?xml version="1.0" encoding="UTF-8"?>
<datasources>
  <local-tx-datasource>
      <jndi-name>GraymoundDS</jndi-name>
      <connection-url>jdbc:postgresql://localhost:5432/GRAYMOUND_POC</connection-url>
      <driver-class>org.postgresql.Driver</driver-class>
      <user-name>postgres</user-name>
      <password>postgres</password>
      <check-valid-connection-sql/>
      <min-pool-size>2</min-pool-size>
      <max-pool-size>10</max-pool-size>
      <idle-timeout-minutes>0</idle-timeout-minutes>
   </local-tx-datasource>
</datasources>
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.