I have just tried synchronized JMS request/reply based on example of JavaEE5. I use netbeans IDE with nested glassfish app server as working environment. No matter I use transaction or not, the session bean can't receive the reply of the request it just sent out. With a web tier client POJO, it is fine to send and receive thereafter. Could you share your experience regarding this? Is it specific to glassfish or all of the app servers are similar?
JavaEE5 just say that you can't do them in the same transaction. so I anotate the bean method with "NOT_SUPPORTED"transaction attribute on the method. but it doesn't work at all. By the way, I also tried the JMS session creation with transaction parameter both true and false. the request can be sent out, and the remote MDB also processed the reqeust and sent back the reply to the specified Queue, however, the receiver can't get it within that session bean.
I have just tried synchronized JMS request/reply based on example of JavaEE5
I'm assuming you mean "synchronous" here.
JavaEE5 just say that you can't do them in the same transaction. so I anotate the bean method with "NOT_SUPPORTED"transaction attribute on the method. but it doesn't work at all.
Container provided JMS resource managers require a transaction when sending or receiving messages. If you try and send a JMS message without a transaction, the message will never be sent. Messages are only sent when the current transaction commits.
If I was you I'd try using bean-managed transactions, that way you get the fine grained control you need for this kind of task. For example.
I'm sure if you Google on this topic you'll find plenty of examples.
SCJP, SCWCD, SCBCD, SCEA 5
posted 9 years ago
Thanks Mr. Wright! You are correct. That works fine this way. I was worry about I have to expose JMS service to web tier.
The following links are useful in case someone search the same topic: