• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DB Connection null error

 
Swetha Raju
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
Scott Selikoff
author
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Brian Hart II
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is likely something fundamentally wrong with your code if it takes an hour to process 5,000 records then fail. Can you post the relevant code?
 
Scott Selikoff
author
Saloon Keeper
Posts: 4020
18
Eclipse IDE Flex Google Web Toolkit
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Brian Hart II:
There is likely something fundamentally wrong with your code if it takes an hour to process 5,000 records then fail. Can you post the relevant code?


Not necessarily, if its sending one record at a time instead of a batched set of records this performance is far more common that you'd thing for computers not directly connected to one another.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic