3 Replies Latest reply on Apr 10, 2002 11:01 AM by Lazzarini

    Issues

    Lazzarini Newbie

      Hello,

      As part of my final training period in ESIAL (French engineering school) I am currently building a client/server application based on the JBoss framework. It is definitely a great piece of software: congratulations for your work !

      I have been using JBoss 3 (alpha, beta, beta2) for 7 months now, mainly because I needed the CMP 2 features.
      And I would like to report some "strange behavior".

      I am running Win2k Pro SP2, I have downloaded the latest release (cvs this morning) and compiled it using JDK 1.4. I start the server with a JAVA_OPTS set to "-Dpolicy.expandProperties=false". At the moment, our application can use Hypersonic or IBM DB2 dbms, depending on the datasource which is set and the appropriate jbosscmp-jdbc.xml file (this is set at install).

      Here is a list of issues:
      1) the EJB-Verifier is reporting warnings when deploying beans:

      2002-04-10 09:48:34,415 INFO [org.jboss.ejb.EJBDeployer]
      Bean : TSomething
      Section: 10.8.1
      Warning: The primkey-field must be one of the CMP fields of the entity bean.

      But the ejb-jar.xml is ok: it was generated automatically, and it contains the primkey-field.

      <display-name>TSomething</display-name>
      <ejb-name>TSomething</ejb-name>
      (...)
      <cmp-field>
      <field-name>Identifier_Something</field-name>
      </cmp-field>
      (...)
      <prim-key-class>java.lang.Integer</prim-key-class>
      <primkey-field>Identifier_Something</primkey-field>
      (...)


      Is there something wrong here ? I have checked the syntax, the case, the orders of declaration but nothing worked (and the DTD is ok). Of course, this is only a warning, but it may be related to other issues.

      2) The file connector\src\etc\example-config\hsqldb-service.xml contains several times "LocalTxCM,name=MySqlDS"
      (instead of name=HsqlDS I guess). But this is not very important.

      3) I created a db2-service.xml based on what I found in example-config (and from previous working configurations), and configured the auth.conf file. Our application works fine when using Hypersonic. But when using DB2, it does not behave as it should. For instance, if I use a findAllInstances on some particular beans, it works, but JBoss hangs when accessing others. The log grows exponentially, with entries such as:

      2002-04-10 09:51:44,669 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCLoadEntityCommand.TSomething] Executing SQL: SELECT IDENTIFER_SOMETHING (...) FROM ttt.T_SOMETHING WHERE (IDENTIFER_SOMETHING =?) OR (IDENTIFER_SOMETHING=?) OR (IDENTIFER_SOMETHING=?) OR (...) and so on.

      It seems to be related to the new jca file, but I do no know if I am missing something here. It works with Hypersonic, and it worked with previous releases of JBoss.

      Any ideas ?

      Thanks.

      PS: I am sorry, I tried to attach both db2-service.xml and hsql-service.xml files, but it will not work, the web server is not responding.

        • 1. Re: Issues
          Lazzarini Newbie

          Follow up:

          3) As a matter of fact, JBoss does not hang forever as I first though, but it is working (almost silently).
          The problem is: I have a table which contains 328 records (small records), and it takes more than 100s on first call (on a 550 Mhz server with 256 mbytes) just to retrieve the data from db2 via a 10 Mbps lan adapter, using the app driver. The server log grew by 5 mbytes just for one call to findAllInstances, with debug turned on. The same thing happens if I repeat calls to findAllInstances, it takes the same amount of time.
          Is it normal ? Am I missing something ? Is it debugging which slows everything down ? Is there a &gt;100:1 ratio when debugging is on ?

          4) I had forgotten this point: has anyone managed to have the &lt;create-table&gt;/&lt;drop-table&gt; work with DB2 ? It will not work, it always attempts to recreate the table even if they already exist.

          5) In my jbosscmp-jdbc.xml, I use the DB2 type-mapping, but then if I want to use SQL DATE, I have to define explicity the mapping, ie:
          &lt;cmp-field&gt;
          &lt;field-name&gt;anyydate&lt;/field-name&gt;
          &lt;column-name&gt;ANYDATE&lt;/column-name&gt;
          &lt;jdbc-type&gt;DATE&lt;/jdbc-type&gt;
          &lt;sql-type&gt;DATE&lt;/sql-type&gt;
          &lt;/cmp-field&gt;

          I mean it does not seem to consider the default mapping for DB2 DATES defined in conf/standardjbosscmp-jdbc.xml.
          First, I though it was due to an undefined DTD reference, but then everything apart from DATE works fine.

          Thanks.

          • 2. Re: Issues
            Lazzarini Newbie

            Follow-up:

            3) MY APOLOGIES !
            In fact, retrieving data takes less than 100ms within the JBoss server with commit-option A, the issue is somewhere else, probably involving client/server communications based on XML and session facades. I think JBoss.Net and web services should do better there, I will have a look at it.

            Thanks.

            • 3. Re: Issues
              Lazzarini Newbie

              I can't get the web server responding to my files posting, so here they are:

              db2-service.xml:

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

              <!-- ===================================================================== -->
              <!-- -->
              <!-- JBoss Server Configuration -->
              <!-- -->
              <!-- ===================================================================== -->



              <!-- ==================================================================== -->
              <!-- New ConnectionManager setup for default IBM DB2 dbs -->
              <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
              <!-- ==================================================================== -->


              <!--make the rar deploy! hack till better deployment-->
              jboss.jca:service=RARDeployer
              <depends optional-attribute-name="ManagedConnectionFactoryName">
              <!--embedded mbean-->

              <!--hack-->
              <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter
              <!--real attributes-->


              <config-property>
              <config-property-name>ConnectionURL</config-property-name>
              <config-property-type>java.lang.String</config-property-type>
              <config-property-value>jdbc:db2:Database</config-property-value> <!-- Database set to whatever location needed -->
              </config-property>
              <config-property>
              <config-property-name>DriverClass</config-property-name>
              <config-property-type>java.lang.String</config-property-type>
              <config-property-value>COM.ibm.db2.jdbc.app.DB2Driver</config-property-value> <!-- Use the app driver -->
              </config-property>
              <config-property>
              <config-property-name>UserName</config-property-name>
              <config-property-type>java.lang.String</config-property-type>
              <config-property-value />
              </config-property>
              <config-property>
              <config-property-name>Password</config-property-name>
              <config-property-type>java.lang.String</config-property-type>
              <config-property-value />
              </config-property>


              DB2DS


              <depends optional-attribute-name="ManagedConnectionPool">

              <!--embedded mbean-->

              0
              50
              500000
              15
              <!--
              criteria indicates if Subject (from security domain) or app supplied
              parameters (such as from getConnection(user, pw)) are used to distinguish
              connections in the pool. Choices are
              ByContainerAndApplication (use both),
              ByContainer (use Subject),
              ByApplication (use app supplied params only),
              ByNothing (all connections are equivalent, usually if adapter supports
              reauthentication)-->
              ByContainer


              <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
              java:/jaas/DB2DbRealm
              java:/TransactionManager







              hsqldb-service.xml:

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

              <!-- ===================================================================== -->
              <!-- -->
              <!-- JBoss Server Configuration -->
              <!-- -->
              <!-- ===================================================================== -->

              <!-- $Id: hsqldb-service.xml,v 1.1 2002/04/08 15:37:55 d_jencks Exp $ -->



              <!-- ==================================================================== -->
              <!-- New ConnectionManager setup for default hsql dbs -->
              <!-- ==================================================================== -->


              <!--make the rar deploy! hack till better deployment-->
              jboss.jca:service=RARDeployer


              <depends optional-attribute-name="ManagedConnectionFactoryName">
              <!--embedded mbean-->

              <!--hack-->
              <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=Minerva JDBC LocalTransaction ResourceAdapter
              jboss:service=Hypersonic

              <!--real attributes-->


              <config-property>
              <config-property-name>ConnectionURL</config-property-name>
              <config-property-type>java.lang.String</config-property-type>
              <config-property-value>jdbc:hsqldb:hsql://localhost:1476</config-property-value>
              </config-property>
              <config-property>
              <config-property-name>DriverClass</config-property-name>
              <config-property-type>java.lang.String</config-property-type>
              <config-property-value>org.hsqldb.jdbcDriver</config-property-value>
              </config-property>
              <config-property>
              <config-property-name>UserName</config-property-name>
              <config-property-type>java.lang.String</config-property-type>
              <config-property-value></config-property-value>
              </config-property>
              <config-property>
              <config-property-name>Password</config-property-name>
              <config-property-type>java.lang.String</config-property-type>
              <config-property-value></config-property-value>
              </config-property>


              DefaultDS


              <depends optional-attribute-name="ManagedConnectionPool">
              <!--embedded mbean-->

              0
              50
              5000
              15
              <!--criteria indicates if Subject (from security domain) or app supplied
              parameters (such as from getConnection(user, pw)) are used to distinguish
              connections in the pool. Choices are
              ByContainerAndApplication (use both),
              ByContainer (use Subject),
              ByApplication (use app supplied params only),
              ByNothing (all connections are equivalent, usually if adapter supports
              reauthentication)-->
              ByContainer


              <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager
              java:/jaas/HsqlDbRealm
              java:/TransactionManager



              <!-- Moved to end to test anonymous depends -->


              1476
              true
              default
              false




              I hope this will help.

              Regards.