If I've understood your question in the right way, I think what you are trying to do is to fire messages on transaction completion. So, I think instead of thing this job on your end.. let the container to do its job. For that.. use XAConnectionFactory to bound your JMS with JTA transaction.
The effect of this bonding will be that fire as many as message during your process, but all will be published on the destination only when JTA transaction completes.
Thanks for your answer.
But I think I'm looking for something else that maybe does not exist.
I would prefer that each message from a transaction is commited in database when the jms "send" command is executed (with the transaction_id). But messages inserted are not "visible" from jms consumers as they are not commited from the JMS transaction point of view. When the jms commit occurs, all messages are updated in database and become visible from jms consumers.