Can you explain the issue in more detail? You write
> the JMS message is sent when the transaction manager decides that the commit is valid.
It's up to the JMS provider to decide when to actually send the message from the producing client to the JMS server. It's fine to sent it immediately (when the application calls MessageProducer.send()). When the JMS server receives the message it can add it to the queue or topic but (assuming we're in a Java EE transaction) must not commit the operation.
> That doesn't mean the actual database commit is now visible!
When the transaction on the client is committed, the transaction manager will call commit() on the XAResource object provided by the JMS client. The JMS client will send the commit to the JMS server which will then commit the previous addition of the message to the queue or topic. The message will then become available for delivery to consumers.
> This hurt us badly and we had to use the TransactionSynchronizationRegistry to work around this issue.
Please provide more information to allow us to understand the problem.