1. How is the database accessed? Entity beans or direct SQL?
2. Why not just setup a no-tx datasource for the MySQL database using a read-only user? perfomance?
3. HSQL is not a production db. You could use a local MySQL and using MySQL master-slave
replication to solve the problem!
PS: Remember that you need to be aware of caching if you not using direct SQL DS.
1. Entity beans. Though for my intermittent process, it can be either since all it will do is transfer data, not perform logic on the contents.
2. Performance. Any data processing that can be done outside of the database needs to be done outside of it.
3. Noted. (Though, probably more important is that I'm using the columnDefinition setting in a few of my @Column annotations, which locks my entities in to MySQL. Setting up a local version instead of HSQL isn't a big issue, though.)
So far, the best that I've seen for running something at start is to use a ServletContextListener that I reference in the <listener> tag of web.xml. Should that work alright? If I attach a callback to a timer on a 30 minute delay, should that work fine as well?
If you are using JBoss AS6 then you have the Java EE6 spec specified @Startup @Singleton beans which can be used to do your startup activities. Java EE6 also have advanced timer functionality including auto-timers (i.e. you don't have to programatically explicitly create the timers).
We're using AS 5 (5.1) and wouldn't want to upgrade to 6 (we're going live in a month or two and wouldn't want to move to a beta version of JBoss for just this).
In JBoss 5 you could instead of @Singleton bean use a standard MBean perhaps if you programmatically want to start a thread that does all the work with a sleep() in it.