Can the java client join a DB transaction?

No. Elasticsearch is not transactional.

What people are normally doing (ie Hibernate Search team - cc @Sanne ) is to use a Transactional MQ system in the middle. If the message can't be delivered to ES, it basically rollbacks the message, which rollbacks the transaction. (If I got it correctly).

I was doing something similar in the past. It was not ideal but at least was a good safeguard.

My 2 cents.