This week's book giveaway is in the OCPJP forum. We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line! See this thread for details.
I am using Spring along with JPA for persistence. Transaction are getting managed by Spring. I came across a situation where i need to commit the transaction. Below is the senarios
1. Method A has Updates columns of the table.
2. After update, method A calls web service (Another application) to generate reports. In web service, we pull the data from same database.
3. Still JPA/Spring has not committed the transaction. Because of this, in web service we are getting the old data not updated in method A calls.
Only one solution, i can think is to commit the transaction before calling webservice. Even if i tried Entity.flush() method also but it is also not committing the transaction.
Transaction is getting committed at the end of the method call. (Post web service call).