0 Replies Latest reply on Oct 2, 2002 10:52 AM by Dennis Carroll

    JBoss/Oracle data corruption

    Dennis Carroll Newbie

      I am deploying Itracker 1.3.2 (http://sourceforge.net/projects/itracker) to JBoss-3.0.2/Oracle8i and am getting corrupt data stored when I create a new user. I have successfully deployed the app on JBoss-3.0.2/MySql where this problem does not appear.

      The first 3 characters of the LOGIN column of the userbean table get trashed. Here is the DDL used to create the tgable.

      create table userbean (
      id NUMBER PRIMARY KEY,
      login VARCHAR2(255),
      password VARCHAR2(255),
      first_name VARCHAR2(255),
      last_name VARCHAR2(255),
      email VARCHAR2(255),
      status NUMBER,
      super_user NUMBER,
      create_date DATE,
      last_modified DATE,
      preferences_id NUMBER
      );

      When the userbean is created the message in the server log from the oracle deployment is:
      2002-10-02 07:17:27,400 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.UserBean] Executing SQL: INSERT INTO USERBEAN (id, login, password, first_name, last_name, email, status, super_user, create_date, last_modified, preferences_id) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
      2002-10-02 07:17:27,400 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCCreateEntityCommand.UserBean] Rows affected = 1
      2002-10-02 07:17:27,400 DEBUG [cowsultants.ITracker] Created user: carr1den, Dennis Carroll.

      The last log entry is there because I modified UserHandlerBean:createUser to log
      String msg="Created user: "+user.getLogin()+", "+user.getFirstName()+" "+user.getLastName()+".";
      just before the end of the method. The corrupted data that gets stored in the login column is something like [B]öCÀr1den[/B]

      To set up jboss I :
      1. Remove hsqldb-service.xml from server/default/deploy
      2. Copy oracle-service to server/default/deploy and change all OracleDS to DefaultDS
      3. Set the <type-mapping> in standardjaws.xml to <type-mapping>Oracle8</type-mapping> and the <datasource-mapping> in standardjbosscmp-jdbc.xml to <datasource-mapping>Oracle8</datasource-mapping>

      When viewing the table attributes with the squirrel jdbc client the LOGIN column properties are
      DATA_TYPE - 12
      TYPE_NAME - VARCHAR2
      COLUMN_SIZE - 255
      DECIMAL_DIGITS -

      The ID column properties are
      DATA_TYPE - 3
      TYPE_NAME - NUMBER
      COLUMN_SIZE - 22
      DECIMAL_DIGITS -

      Is there a type mapping problem of some kind. I do not understand this part of the jboss configuration. If not, what might the problem be?

      Thanks,
      Dennis