Need to insert data in database using multiple threads ,but even if a single thread fails to commit,all transaction must rollback.Tried to solve this by below approach.
Sharing connection object among thread,and using join()
to wait for child thread to finish,but this looks like bad design,as i am sharing connection object among threads.
Can someone suggest better design to solve this (Not sure should i go for distributed txn manager or not)?