Is the TimerTask using an EntityManager to update the flag? Can you post the code for this process? The details on how the TimerTask hands off the messages and the state of the transaction are unclear. If it is a separate thread and a different Session Bean method for the method process it will be a different transaction unless you have taken steps to make them the same or your actual process flow is different than I have interpreted.
Make sure all of your code is using JPA and ensure that the TimerTask is committing it's transaction before the message processor begins.
--Gordon
[Message sent by forum member 'gyorke' (gyorke)]
http://forums.java.net/jive/thread.jspa?messageID=276588