JBoss Community

Transactions with JBoss Messaging and SeamTest not behaving as expected.

created by Corneil du Plessis in JBoss Messaging - View the full discussion

I am experiencing a problem with JMS messages being available and read by listening MDB before the original transaction has completed committing.

 

The following steps outline the problem:

  • Insert message to queue
  • Listener reads queue and creates an entity.
  • Listener also publishes information classname/id to topic.
  • Topic listener reads entity using classname and id but object is not found.

 

If topic listener sleeps before attempting to read the entity the object is available.

 

I have created a project that illustrates the problem.

 

The project is an Eclipse project with Maven pom.

 

To get the project to work you need to copy bootstrap from seam distribution into project folder.

 

Search for TODO in the Java code and uncomment the sleep statement to see the difference made by delaying the topic listener.

Reply to this message by going to Community

Start a new discussion in JBoss Messaging at Community