2 Replies Latest reply on Oct 20, 2007 6:38 PM by Manik Surtani

    Problem with SEAM  + CMT Transaction + JBossCache

    Eugene Batogov Newbie

      Hello all !
      I have the problem with update JBossCache, after commit changes from SEAM application.
      ----------------------------------------
      My environments:
      1. OS: Gentoo Linux x86
      2. JDK: 1.6 SUN and BEA JRockIt
      3. IDE: Eclipse-3.2.2
      4. AS: JBoss-4.2.1.GA
      5. ORM : Hibernate-3.2.5.GA
      6. JBoss SEAM 1.2.1.GA and 2.0.RC2
      7. JBoss Cache 1.4.1.SP4
      -----------------------------------------
      I have EAR with 2 ejb-jars and 2 wars.
      First ejb-jar has all entities of application.
      ----------------------------------------------
      persistence.xml (from first ejb-jar):

      <?xml version="1.0" encoding="UTF-8"?>

      <persistence-unit name="mydb_pu" transaction-type="JTA">
      <jta-data-source>java:/jdbc/mydb</jta-data-source>












      true

      </persistence-unit>

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

      Second ejb-jar consists of seam managed beans.

      pertistence.xml (from second ejb-jar):
      -------------------------------
      <?xml version="1.0" encoding="UTF-8"?>
      <persistence 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_1_0.xsd"
      version="1.0">
      <persistence-unit name="mydb_pu" transaction-type="JTA">
      <jta-data-source>java:/jdbc/mydb</jta-data-source>








      </persistence-unit>

      -------------------------------
      Web application from first war, use SEAM!! (1.2.1.GA or 2.0.RC2)
      Web application from second war don't use SEAM and invoke EJB session beans from first jar (which has entities and session beans).

      JBoss Cache enable how mbean!

      If I do commit (insert/update) from second web application (without SEAM), then transactional cache update dirty data successful (across invoke ejb3 session beans )!

      But If I do commit from SEAM web application (bypass EJB3 session beans), then JBoss Cache don't see that data is OLD yet !!!

      I know, that JTS is responsible for report to JBoss cache about all transactions.
      -----------------------------------------------
      In components.xml I have next:
      ....
      <persistence:managed-persistence-context name="entityManager"
      auto-create="true"
      persistence-unit-jndi-name="java:/mydbEntityManagerFactory" />
      <transaction:ejb-transaction/>

      ....
      -----------------------------------------------

      But it don't force update cache !!!!
      All commits (insert/update) work OK, but JBoss Cache don't see its changes !!!
      I have read reference documentation about SEAM, but it don't help !

      1. How SEAM work with CMT transaction ?
      2. How SEAM work with jBoss Cache ?
      3. How I may update old data ?

      May anybody help me !!!

      Thanks in advance !

      P.S. JBoss cache work OK. All regions works. Cache hits exists !:)