• Post Reply Bookmark Topic Watch Topic
  • New Topic

JdbcTemplate and Multi-threading

 
Yile Ku
Greenhorn
Posts: 13
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am creating a single JdbcTemplate and passing it into several threads to update multiple records (a thread per record) in a database. Eventually I get an exception saying the data base is closed.
Whats the right way to do this?
M-
 
T Mishra
Ranch Hand
Posts: 108
Eclipse IDE Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This might be happening.
Concurrent update -> dirty reads -> JdbcTemplate throws SqlException -> JdbcTemplate closes connection
 
my overalls have superpowers - they repel people who think fashion is important. Tiny ad:
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!