I have the following pattern

I have two kinds of databases. One is a int
Add a QueueChannel somewhere upstream (i.e. before the pub sub channel for tx2) and use a <transactional/> poller to start the transaction.
Alternatively, insert a transactional gateway...
<int:service-activator ... ref="txGw" />
<int:gateway ... service-interface="TX" />
public interface TX {
@Transactional
Message<?> exchange(Message<?> m);
}
You'll need <tx:annotation-driven /> to enable transactions in the second case.