The response received from web service I am writing it to the database in background thread. At the same time I am performing other database operation because that application facing deadlock as explained here. As mentioned in the link there are two possible approaches
- Don't make writer thread to join reader thread.As mentioned here I am trying to use java thread in a such way that deadlock should not occur while performing database operation. I have used synchronized block to achieve this but it didn't helped. 
- I am not using second approach because it risk to lose data. 
How should I resolve this issue?
 
     
    