即使数据源已关闭,如何使用JBoss部署Java Web应用程序?

时间:2016-05-03 17:59:44

标签: java jboss

我目前正在使用Jboss开发一个java web应用程序,我使用多个数据源。我们的想法是,即使其中一个存在下来,应用程序仍然应该运行,很明显没有数据源的数据丢失。这可能吗?我已尝试使用persistence.xml进行各种思考

这是我的persistence.xml

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0" xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
  <persistence-unit name="dinwebCAPU" transaction-type="JTA">
    <jta-data-source>java:/jboss/datasources/EmpCant</jta-data-source>
    <class>saedi.entidad.VwFamiliaEmpenio</class>
    <class>saedi.entidad.CatCli</class>
    <class>saedi.entidad.VwClienteEmpenio</class>
    <class>saedi.entidad.VwRefrendos</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties>
      <property name="javax.persistence.schema-generation.database.action" value="create"/>
    </properties>
  </persistence-unit>
  <persistence-unit name="dinwebC69" transaction-type="JTA">
    <jta-data-source>java:/jboss/datasources/EmpC69</jta-data-source>
    <class>saedi.entidad.VwFamiliaEmpenio</class>
    <class>saedi.entidad.CatCli</class>
    <class>saedi.entidad.VwClienteEmpenio</class>
    <class>saedi.entidad.VwRefrendos</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties>
      <property name="javax.persistence.schema-generation.database.action" value="create"/>
    </properties>
  </persistence-unit>
  <persistence-unit name="WEBDINPU" transaction-type="JTA">
    <jta-data-source>java:/jboss/datasources/DINWEBDS</jta-data-source>
    <class>entidad.Cliente</class>
    <class>entidad.Clientedocto</class>
    <class>entidad.Colonia</class>
    <class>entidad.CteSucImportado</class>
    <class>entidad.Empresa</class>
    <class>entidad.Estado</class>
    <class>entidad.Localidad</class>
    <class>entidad.Municipio</class>
    <class>entidad.Oficio</class>
    <class>entidad.Pais</class>
    <class>entidad.Persona</class>
    <class>entidad.Sucursal</class>
    <class>entidad.Tipodocto</class>
    <class>seguridad.entidad.Bitacora</class>
    <class>seguridad.entidad.Usuario</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties>
      <property name="javax.persistence.schema-generation.database.action" value="create"/>
    </properties>
  </persistence-unit>
  <persistence-unit name="dinwebC67" transaction-type="JTA">
    <jta-data-source>java:/jboss/datasources/EmpC67</jta-data-source>
    <class>saedi.entidad.VwFamiliaEmpenio</class>
    <class>saedi.entidad.CatCli</class>
    <class>saedi.entidad.VwClienteEmpenio</class>
    <class>saedi.entidad.VwRefrendos</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties/>
  </persistence-unit>
  <persistence-unit name="dinwebCOC" transaction-type="JTA">
    <jta-data-source>java:/jboss/datasources/EmpCoc</jta-data-source>
    <class>saedi.entidad.VwFamiliaEmpenio</class>
    <class>saedi.entidad.CatCli</class>
    <class>saedi.entidad.VwClienteEmpenio</class>
    <class>saedi.entidad.VwRefrendos</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties/>
  </persistence-unit>
  <persistence-unit name="dinwebCHUP" transaction-type="JTA">
    <jta-data-source>java:/jboss/datasources/EmpChub</jta-data-source>
    <class>saedi.entidad.VwFamiliaEmpenio</class>
    <class>saedi.entidad.CatCli</class>
    <class>saedi.entidad.VwClienteEmpenio</class>
    <class>saedi.entidad.VwRefrendos</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties>
    </properties>
  </persistence-unit>
  <persistence-unit name="dinwebJPPU" transaction-type="JTA">
    <jta-data-source>java:/jboss/datasources/EmpJP</jta-data-source>
    <class>saedi.entidad.VwFamiliaEmpenio</class>
    <class>saedi.entidad.CatCli</class>
    <class>saedi.entidad.VwClienteEmpenio</class>
    <class>saedi.entidad.VwRefrendos</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties/>
  </persistence-unit>
  <persistence-unit name="dinwebMLPU" transaction-type="JTA">
    <jta-data-source>java:/jboss/datasources/EmpML</jta-data-source>
    <class>saedi.entidad.VwFamiliaEmpenio</class>
    <class>saedi.entidad.CatCli</class>
    <class>saedi.entidad.VwClienteEmpenio</class>
    <class>saedi.entidad.VwRefrendos</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties/>
  </persistence-unit>
  <persistence-unit name="dinwebUMPU" transaction-type="JTA">
    <jta-data-source>java:/jboss/datasources/EmpUma</jta-data-source>
    <class>saedi.entidad.VwFamiliaEmpenio</class>
    <class>saedi.entidad.CatCli</class>
    <class>saedi.entidad.VwClienteEmpenio</class>
    <class>saedi.entidad.VwRefrendos</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties/>
  </persistence-unit>
  <persistence-unit name="dinwebOTPU" transaction-type="JTA">
    <jta-data-source>java:/jboss/datasources/EmpOte</jta-data-source>
    <class>saedi.entidad.VwFamiliaEmpenio</class>
    <class>saedi.entidad.CatCli</class>
    <class>saedi.entidad.VwClienteEmpenio</class>
    <class>saedi.entidad.VwRefrendos</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties/>
  </persistence-unit>
  <persistence-unit name="dinwebPAPU" transaction-type="JTA">
    <jta-data-source>java:/jboss/datasources/EmpPa1</jta-data-source>
    <class>saedi.entidad.VwFamiliaEmpenio</class>
    <class>saedi.entidad.CatCli</class>
    <class>saedi.entidad.VwClienteEmpenio</class>
    <class>saedi.entidad.VwRefrendos</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties/>
  </persistence-unit>
  <persistence-unit name="dinwebPGPU" transaction-type="JTA">
    <jta-data-source>java:/jboss/datasources/EmpPro</jta-data-source>
    <class>saedi.entidad.VwClienteEmpenio</class>
    <class>saedi.entidad.VwFamiliaEmpenio</class>
    <class>saedi.entidad.CatCli</class>
    <class>saedi.entidad.VwRefrendos</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties/>
  </persistence-unit>
  <persistence-unit name="dinwebKAPU" transaction-type="JTA">
    <non-jta-data-source>java:/jboss/datasources/EmpKan</non-jta-data-source>
    <class>saedi.entidad.CatCli</class>
    <class>saedi.entidad.VwClienteEmpenio</class>
    <class>saedi.entidad.VwFamiliaEmpenio</class>
    <class>saedi.entidad.VwRefrendos</class>
    <exclude-unlisted-classes>true</exclude-unlisted-classes>
    <properties/>
  </persistence-unit>
</persistence>

0 个答案:

没有答案