0 Replies Latest reply on Jun 15, 2006 10:26 AM by Andrea Pelagotti

    accessing wrong Oracle schema

    Andrea Pelagotti Newbie

      -1 linux server, with 2 jboss instances, named JB1 and JB2 (two linux processes created by two different linux users).
      -1 Oracle RAC database, implemented on 2 linux servers (i.e. 2 nodes)
      -2 different schemas on Oracle, USR1 and USR2, with different passwords, same tables but different data inside.

      JB1 is configured to access data on schema USR1, JB2 to access schema USR2.

      Problem: in the log file of JB1, sometimes I get an error like "USR2.FK1" violated , where FK1 is a foreign key. In other words, it seems that sometimes JB1 try to write data on USR2.
      Besides, it happens that in the same db transaction the first query is executed on schema USR1 while the second query on USR2.
      The foreign key violation is due to different data in parent tables.

      Please keep into consideration that JB1 does not know anything about user/passowrd of schema USR2 (and viceversa).

      Technical data:

      I'm using jboss 4.0.3sp1 on linux red-hat 4, connecting to database Oracle 10.0.2 using thin with ojdb14.jar library. Oracle is installed as RAC on two linux servers. The string database connection is something like: connection.url=jdbc:oracle:thin:@(DESCRIPTION=

      "USR1_PROA" is an oracle (rac) service configured to established a connection on the first oracle server miprodb01 (preferred) or (if unavaible) on the second oracle server miprodb02.

      A connection pool is configured with system properties file loaded on Jboss startup:

      <connection-url>...see above...</connection-url>
      <!-- Checks the Oracle error codes and messages for fatal errors -->
      <!--pooling parameters-->

      The query involved are different, an example is:
      INSERT INTO MYTABLE (F1, F2) values (1234, 4567).
      I use prepared statement.

      Does anyone face the same problem?