I have this batch process running with Java and DB used it MS SQL.THe process takes about an hour to complete.The process suddenly fails in between because of DB Connection failing.I get a DB connection null after lets say after processing some 5000 records and that is consistant.Not sure why this is happening.Any clue why this could happen?
Check the database configuration (and network configuration of the server) it's quiet possible there's a maximum time out set. Oh and for performance, are you using JDBC batch tools? Keep in mind if you have, say 100,000 records to insert, the optimal solution is often of the form to send them to the database in 200 sets of 500 records, thereby using 200 small/medium sized network transports. Other solutions such as sending one at a time (100,000 connections) or all at once (1 huge package) fail for network-related reasons. The first fails for time, the overhead of creating/sending each message is too big. The second fails often because of a package limit on the server or network.