I have been trying to use spring 3.0 SimpleJdbcTemplate and it takes 5 mins to insert 1500 records, whereas it take me a few secs. to insert using straight JDBC. Not sure what I am doing wrong.
If you are building batch consider using Spring batch - JdbcBatchItemWriter
with proper chunk size settings, that will load these 1500 records in less than a second.
Some things worth checking:
transactionManager
). If you are using JTA, that's probably where your problem is. Since it's fast with JDBC the bottleneck doesn't seem to be the db.Quick way to profile your app:
Get the pid - "jps -l"
Memory: jmap -histo PID
(check if there's some form of memory leak)
Check what's going on under the hood: jstack PID
(look for slow or recursive method calls)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With