Persistance Queue Implementation
design-patterns, java, multithreading, oop, persistence
Solution
Take a look at this previous Stackoverflow question:
Producer/Consumer threads using a Queue
The first answer talks of implementing a Producer-Consumer (which is what you want) using the ExecutorService. This is one way to do what you want, but it uses an in memory queue - you could quite easily change this to a JMS Queue though.
Problem
I was reading an article on Batch Processing in java over at JDJ http://java.sys-con.com/node/415321 . The article mentioned using a persistence queue as a Batch Updater instead of immediately sending an individual insert or update to the database. The author doesn't give a concrete example of this concept so I googled Persistence Queue but that didn't come up with much. Does anyone know of a good example of this?