Re: Manual/Programatical OpenJMS DB manipulation

Tim Anderson <[email protected]> Sat, 21 Apr 2007 22:44:25 +1000
Newsgroups gmane.comp.java.openjms.user
Message-ID <[email protected]>
Hemant Gaur wrote:
>
> Hi,
> OpenJMS latest release version (0.7.6.1).
>
> Actuallty I want to create a script/java, which can clean up the data 
> base which do not have the expiration time in the messages, for the 
> messages older than say 1 week. I plan to do this using JDBC (reading 
> the JMS  config file)and hence generic to many databases. The need for 
> this feature arises because
> a.) Non-subscribed topic messages are not cleared in DB.
> b.) Keep the DB size in control without making any change in the 
> existing JMS implementaion.
> c.) Scalability issues with the various light-weight databases and 
> OpenJMS.
>
> In OpenJMS last release version (0.7.6.1), after stopping the JMS server.
>
> 1.) Is it safe to delete the messages from the messages table which 
> have no corresponding entry in the message_handles ?
>
Yes.
>
>
> 2.) Can also the related messages set determined my message_id's can 
> be deleted from the both tables. Say delete the entries for particular 
> message in both the tables.
>
You can delete all entries for a particular message by deleting from 
both all records from both tables that match the specified message id.

-Tim

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/