JBOSS Spring Web
jndi:
<datasources>
<xa-datasource>
<jndi-name>jdbc/sss-local</jndi-name>
<track-connection-by-tx />
<isSameRM-override-value>false</isSameRM-override-value>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:thin:@ssssit.dbsit.sfdc.com.cn:1521:ssssit</xa-datasource-property>
<user-name>sss</user-name>
<password>sfpwd12345#</password>
<!--<security-domain>sssWS-local</security-domain>-->
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<no-tx-separate-pools />
<metadata>
<type-mapping>Oracle11g</type-mapping>
</metadata>
<min-pool-size>200</min-pool-size>
<max-pool-size>300</max-pool-size>
</xa-datasource>
<xa-datasource>
<jndi-name>jdbc/rms-xa</jndi-name>
<track-connection-by-tx />
<isSameRM-override-value>false</isSameRM-override-value>
<xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
<xa-datasource-property name="URL">jdbc:oracle:thin:@sfosssit.dbsit.sfdc.com.cn:1521:sfosssit</xa-datasource-property>
<user-name>exp5</user-name>
<password>sfpwd12345#</password>
<!--<security-domain>sapWS-local</security-domain>-->
<exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
<no-tx-separate-pools />
<metadata>
<type-mapping>Oracle10g</type-mapping>
</metadata>
</xa-datasource>
<mbean code="org.jboss.resource.adapter.jdbc.vendor.OracleXAExceptionFormatter" name="jboss.jca:service=OracleXAExceptionFormatter">
<depends optional-attribute-name="TransactionManagerService">jboss:service=TransactionManager</depends>
</mbean>
</datasources>
beans.xml:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
<import resource="classpath:com/sf/integration/norm/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/common/META-INF/config/beans.xml"/>
<import resource="classpath:com/sf/integration/standAddrNew/META-INF/config/beans.xml"/>
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiName" value="java:jdbc/aip" />
<property name="resourceRef" value="true" />
</bean>
<bean id="sessionFactoryAutowiring" class="com.sf.framework.server.core.deploy.SessionFactoryAutowiring">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
<bean id="defaultLobHandler" class="org.springframework.jdbc.support.lob.DefaultLobHandler" lazy-init="true"/>
<bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="mappingResources">
<list>
<value>com/sf/integration/norm/META-INF/config/mapping.xml</value>
<value>com/sf/integration/standAddrNew/META-INF/config/mapping.xml</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.Oracle10gDialect</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.jdbc.batch_size">50</prop>
</props>
</property>
<property name="lobHandler" ref="defaultLobHandler" />
</bean>
</beans>
web.xml:
<?xml version="1.0" encoding="UTF-8"?>
<web-app version="2.5"
xmlns="http://java.sun.com/xml/ns/javaee"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/javaee
http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
<context-param>
<param-name>contextConfigLocation</param-name>
<param-value>/WEB-INF/beans.xml</param-value>
</context-param>
<listener>
<listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
</listener>
<listener>
<listener-class>org.springframework.web.util.IntrospectorCleanupListener</listener-class>
</listener>
<servlet>
<servlet-name>CXFService</servlet-name>
<servlet-class>org.apache.cxf.transport.servlet.CXFServlet</servlet-class>
<load-on-startup>1</load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>CXFService</servlet-name>
<url-pattern>/ws/*</url-pattern>
</servlet-mapping>
<welcome-file-list>
<welcome-file>index.jsp</welcome-file>
</welcome-file-list>
<resource-ref>
<res-ref-name>jdbc/aip</res-ref-name>
<res-type>javax.sql.DataSource</res-type>
<res-auth>Container</res-auth>
</resource-ref>
</web-app>
jboss-web.xml:
<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3V2//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
<jboss-web>
<context-root>aip</context-root>
<resource-ref>
<res-ref-name>jdbc/aip</res-ref-name>
<jndi-name>java:jdbc/aip</jndi-name>
<res-type>javax.sql.DataSource</res-type>
</resource-ref>
</jboss-web>