We have to import a lot of data into a production database from Web services, flat files and other external sources.
We are using spring batch to do this.
One of the major problem is that some of those data are related to each other but won’t be imported at the same time.
The other major problem is that there is a lot of data, so I can’t really make a huge transaction and roll back if a problem occurs.
How could I do that?
Your best best is to load the data into a “holding” table that is not used by your running application. Then look at using SELECT INTO to copy the data into the application tables when the application is least busy.
The advantages to this approach are