8 Replies Latest reply on Oct 31, 2001 3:11 PM by Charles Chan

    JMS JDBC Store ?

    Andrejus Chaliapinas Newbie

      Hi, is it possible somehow to configure JMS Store as JDBC and not file-based? I've found this under WebLogic...

        • 2. Re: JMS JDBC Store ?
          Andrejus Chaliapinas Newbie

          Ok, thanks, I've found on this forum that I also need to create 2 tables: JMS_MESSAGES and JMS_TRANSACTIONS. Anything else ?

          AX

          • 3. Re: JMS JDBC Store ?
            Andrejus Chaliapinas Newbie

            Ok, tried to create 2 additional tables, configured additional pool java:/JmsDB and got a lot of errors, like JmsDB not bound. I'm currently running 2.4.1 JBoss. Do I need to download source code for 2.5.x and try it?

            AX

            • 4. Re: JMS JDBC Store ?
              JAYESH PARAYALI Newbie

              2.4.1 may not have the latest changes. You might want to check out from cvs and build.

              Thanks,
              Jayesh

              • 5. Re: JMS JDBC Store ?
                Nilesh Malpekar Newbie

                Hi All,

                I am a newcomer to this group as well as to JBoss. I was also working on the same problem for one of my projects.

                Following are my observations.
                1. On JBoss-2.4.3_Tomcat-3.2.3 version, inspite of having created the tables (JMS_MESSAGES, JMS_TRANSACTIONS) and index (JMS_MESSAGES_DEST) on DefaultDS, things don't work. For following reasons:
                a. I could not successfully start the PersistenceManager after DefaultDS is bound to 'java:/DefaultDS'.

                I did write an MBean to test that I can successfully order the MBean sequence in jboss.jcml and ensure that my MBean is loaded only after DefaultDS is bound to 'java:/DefaultDS'. This works fine if I make the MBean entry last in the jboss.jcml file. But when I put the MBean for PersistenceManager configuration after this MBean entry, things don't work.

                For this my observation is, error is thrown in the InitService of the PersistenceManager ( I guess it should only be in startService()).

                Having done this, I proceeded towards the latest CVS source code (jboss-3.0.0-alpha).

                This version also has the same problem. But first the good news.
                1. If I remove the jms-service.xml, jbossmq-service.xml files from the deploy directory at the time of startup and place them in deploy directory after server has started successfully. Things work correctly !

                Now the bad news
                1. I try to deploy my MBean through various conf files (xml) but I can not force it to load after DefaultDS is bound to 'java:/DefaultDS' :-(

                I hope someone from development team comment on this and guides me on
                1. whether there is a simple workaround in JBoss-2.4.3_Tomcat-3.2.3
                2. Shall I move on to the 3.0.0 version?

                Also I am not sure how to configure the SQL Server DB on the new version of JBOSS (3.0.0 alpha).


                Cheers

                Nilesh

                • 6. Re: JMS JDBC Store ?
                  Charles Chan Newbie

                  I have done some investigation into how JBoss loads up its services at startup. I think I have found out what causes the problem with PersistenceManager but I cannot offer a solution yet:

                  http://www.jboss.org/modules/bb/index.html?module=bb&op=viewtopic&t=forums/ someone experienced with JBoss's initialization or MBean implementation comment on the above message?

                  Thanks
                  Charles

                  • 7. Re: JMS JDBC Store ?
                    Charles Chan Newbie

                    It took me sometime to find out the schemas for the required tables. I am listing them here (including my own little contribution for PostgreSQL). Btw, do we have any test cases for JDBC Persistence? How do I test if my config. is correct?


                    Interbase :
                    CREATE TABLE JMS_MESSAGES
                    (
                    MESSAGEID CHAR(17) NOT NULL,
                    DESTINATION VARCHAR(30) NOT NULL,
                    MESSAGEBLOB BLOB,
                    PRIMARY KEY (MESSAGEID, DESTINATION)
                    );
                    CREATE INDEX JMS_MESSAGES_DEST ON JMS_MESSAGES(DESTINATION);

                    CREATE TABLE JMS_TRANSACTIONS
                    (
                    ID CHAR(17)
                    )


                    Oracle :
                    CREATE TABLE JMS_MESSAGES
                    (
                    MESSAGEID CHAR(17) NOT NULL,
                    DESTINATION VARCHAR(30) NOT NULL,
                    MESSAGEBLOB LONG RAW,
                    PRIMARY KEY (MESSAGEID, DESTINATION)
                    );
                    CREATE INDEX JMS_MESSAGES_DEST ON JMS_MESSAGES(DESTINATION);

                    PostgreSQL:

                    CREATE TABLE JMS_MESSAGES
                    (
                    MESSAGEID CHAR(17) NOT NULL,
                    DESTINATION VARCHAR(30) NOT NULL,
                    MESSAGEBLOB BYTEA,
                    PRIMARY KEY (MESSAGEID, DESTINATION)
                    );
                    CREATE INDEX JMS_MESSAGES_DEST ON JMS_MESSAGES(DESTINATION);


                    Common:
                    CREATE TABLE JMS_TRANSACTIONS
                    (
                    ID CHAR(17)
                    )

                    • 8. Re: JMS JDBC Store ?
                      Charles Chan Newbie

                      Oops, the PostgreSQL schema should read:

                      CREATE TABLE JMS_MESSAGES
                      (
                      MESSAGEID CHAR(17) NOT NULL,
                      DESTINATION VARCHAR(30) NOT NULL,
                      MESSAGEBLOB OID,
                      PRIMARY KEY (MESSAGEID, DESTINATION)
                      );
                      CREATE INDEX JMS_MESSAGES_DEST ON JMS_MESSAGES(DESTINATION);

                      CREATE TABLE JMS_TRANSACTIONS
                      (
                      ID CHAR(17)
                      )

                      instead... notice that PostgreSQL uses OID for BLOB.

                      Charles