0 Replies Latest reply on Mar 20, 2012 5:40 AM by dmex38

    Undeploy application (WAR/EAR) cause undeploy others applications

    dmex38

      Hello everybody,

       

       

      I have a strange behavior with JBoss AS 7.1.1

       

      I deploy 2 applications (2 war)

      deployment is good, all is running good.

       

      But when I undeploy or redeploy APP1, the server undeploy APP2 and try to restart persistence Unit of APP2 but It's failed.

       

      APP1 / APP2 use separate datasource declared in standalone.xml

      both use second level cache hibernate infinispan...

       

      I check the oder :

       

      -------------------

      deploy APP1

      deploy APP2

       

      undeploy APP1

      APP2 failed (undeploy automatically)

      -----------------------------

      deploy APP2

      deploy APP1

       

      undeploy APP2

      APP1 failed (undeploy automatically)

      -----------------------------

      deploy APP1

      deploy APP2

       

      undeploy APP2 good

      APP1 running normaly

       

      It's as if there was a common element between two application.

      But normaly not.

           Datasources are differents (but same drivers ? MySQL)

          

       

      After others check, It seem , that is caused by Infinispan 2nd Level cache of hibernate

       

      There is something wrong in my persistence.xml ?

       

       

       


      {code: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="App1PU">

          <jta-data-source>java:/App1Datasource</jta-data-source>

          <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>

          <properties>

              <property name="hibernate.dialect"                          value="org.hibernate.dialect.MySQL5Dialect"/>

              <property name="hibernate.connection.isolation"             value="8"/>

              <property name="hibernate.hbm2ddl.auto"                     value="none"/>

              <property name="hibernate.show_sql"                         value="${persistence.show_sql}"/>

              <property name="hibernate.format_sql"                       value="false"/>

              <property name="hibernate.jdbc.batch_size"                  value="40"/> 

              <property name="hibernate.cache.use_second_level_cache"    value="true"/>

              <property name="hibernate.cache.use_query_cache"         value="true" />

          </properties>

          </persistence-unit>

      </persistence>

      {code}

       

      {code: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="App2PU">

          <jta-data-source>java:/App2Datasource</jta-data-source>

          <shared-cache-mode>ENABLE_SELECTIVE</shared-cache-mode>

          <properties>

              <property name="hibernate.dialect"                          value="org.hibernate.dialect.MySQL5Dialect"/>

              <property name="hibernate.connection.isolation"             value="8"/>

              <property name="hibernate.hbm2ddl.auto"                     value="none"/>

              <property name="hibernate.show_sql"                         value="${persistence.show_sql}"/>

              <property name="hibernate.format_sql"                       value="false"/>

              <property name="hibernate.jdbc.batch_size"                  value="40"/> 

              <property name="hibernate.cache.use_second_level_cache"    value="true"/>

              <property name="hibernate.cache.use_query_cache"         value="true" />

          </properties>

          </persistence-unit>

      </persistence>

      {code}

       

      I try to add this :

       

      {code:xml}<property name="hibernate.cache.region_prefix" value="App1PU" />{code}

      with distinct value APP1/APP2

      but without success...

       

      Thanks in advance,

      dmex38