3 Replies Latest reply on Nov 15, 2004 6:16 PM by genman

    Caching messages in Hypersonic database

    topatidle

      Hello,

      I'm running JBoss 3.2.5 on a Windows 2003 Server machine.

      I've noticed that messages posted to a JMS Queue I use in my application are stored in the Hypersonic database.
      What I don't understand is in which scenario a message is moved to the cache (always, on low memory or by configuration), and what is the way to delete the messages from the database.

      My problem is that when the localDB.data file reaches a size of approximatly 2GB I receive an OutOfMemoryException and I need to shut down the JBoss instance.

      Is there a way to prevent messages from being cached into the database?

      Thanks,

      Ziv

        • 1. Re: Caching messages in Hypersonic database
          genman

          Messages are stored by default in the DB when they are added to the server. The limit for HSQLDB is 2GB per table (or DB?).

          The message cache controls which messages are kept in memory, and the messages remain in the database when removed from memory JBoss. Increasing the size of your memory won't increase the size allowed by HSQLDB.

          You can delete messages by clearing each message queue through JMX.

          What is the stack trace of the OOMException?

          You either need to remove messages or use a different database (like MySQL).

          • 2. Re: Caching messages in Hypersonic database
            topatidle

            Hi,

            Thanks for the quick reply.

            I've noticed the I had an error in my previous post - I use a topic, not a queue.
            I did what you wrote (removed all messages), but the size of the file stayed the same. Is it because it was already alocated, and it will not insert new messages to the same space, or did I do something wrong?

            Thanks,

            Ziv

            • 3. Re: Caching messages in Hypersonic database
              genman


              The HSQDB database file won't shrink until you do a clean ashutdown.

              What is the stack trace of the OOMException?

              If you want to continue using HSQLDB, I would use 1.7.2 (which is in 3.2.7RC I believe, or d/l the .jar file from the website.) Otherwise, I suggest going with a free database like Postgres or MySql, especially if your data is large.