3 Replies Latest reply on Apr 27, 2002 11:12 PM by David Jencks

    JDBC persistence with Oracle

    Anthony M Newbie

      Hello,
      We are using JBoss 2.4.4 with Tomcat. We are trying to implement database persistence with messages using Oracle 9i.

      Before we changed to DB persistence, we tested the data file persistence. It seems to update the files under db/jbossmq. we then modifed the jboss.jcml:

      jboss.jcml:

      <!-- The PersistenceManager is used to store messages to DB. -->

      java:/JBossMQDS


      We also have a datasource entry named JBossMQDS in this file.

      After the configuration to JDBC persistence, we restarted the JBoss server. No exceptions were detected. When we run our JMS examples, nothing gets inserted into the JMS_MESSAGES table.

      So we deleted the table out of the database, restarted the JBoss server, and tried to run the JMS examples. We now get an exception, saying the table does not exist. So we know that JBoss is looking for the correct table in the correct datasource. But it never persistes the messages there. We are new to JBoss and JMS. Are we missing something here?

      Anthony

        • 1. Re: JDBC persistence with Oracle
          David Jencks Master

          I think with that version of the jdbc persistence manager you have to use a datasource whose connections have autocommit on. As I recall in 2.4 you do that with a JDBCDataSourceLoader rather than an XADataSourceLoader.

          I think 3.0 has an alternate implementation that can use a normal datasource. However, I'm pretty sure there have been enough changes to make backporting difficult.

          • 2. Re: JDBC persistence with Oracle
            Anthony M Newbie

            Dave,

            I made the configuration changes you suggested. The messages are now stored in the Oracle DB. However, if I restart the JBoss server, we get the following error:

            Could not rebuild the queue from the queue's transaction log. Is the transaction log the jms_transactions table? IF so, I noticed the jms_transactions table is never populated.

            Upon further online reading, use of the JDBCDataLoader is not recommended, it is obsolete. Can we somehow use the XADataSourceLoader?

            Anthony

            • 3. Re: JDBC persistence with Oracle
              David Jencks Master

              Both JDBCDataSourceLoader and XADataSourceLoader have been removed from 3.0. I really think in 2.4 you need to use the JDBCDataSourceLoader. I think the "obsolete" comments were from when I removed JDBCDataSourceLoader from 3.0.

              In my jaundiced opinion it is very possible that there are large bugs in the jdbc persistence manager. You might want to look at the code and see if it appears to be using a tx log in a plausible way. I don't remember if it stores the tx info in the message table or a different table.