Hi everyone:
I am seeing a problem that I could not figure out a solution. Can anyone shed me some lights on this?
I have a EJB method which basically does 2 things: 1). persists a record into a database table using EntityManager 2). sends out a message to a JMS topic. So it is th like:
myMethod() {
entityManager.persist(myObj);
notifier.notify(...);
}
The client will then listen to the JMS topic and read the new record from database. Usually this works pretty well, but sometimes, the client cannot find the new record from database at all and a few seconds later it can. It is as if there is a delay between the JMS messaging and database persistence - somehow the client receives the message first and at this time the record is not really saved into database yet!
Can anyone explain to me what is going on here? What kind of solutions might help to resolve this?
Thanks a lot for your help
jmao
|