Spring JdbcTemplate and Threading

Is it safe to disable Thread to perform insertion using JdbcTemplatein Swing.

This is a registration event, and as much as possible, I do not want this to affect perceived performance.

+3
source share
3 answers

This Spring forum answer says yes:

http://forum.springframework.org/showthread.php?t=25965

JdbcTemplate is a singleton that will not change state after installing it.

+6
source

Also note that its thread safety is very well explained in the Spring 3.1 reference documentation:

13.2.1.2. JdbcTemplate

JdbcTemplate . , , JdbcTemplate DAO ( ). JdbcTemplate , DataSource, .

+8

, ?

I have not used it JdbcTemplatedirectly from Swing, but I have several web applications (which have a separate thread for each request), and I never had problems with streaming problems. In this situation, the template was configured once at application launch and was repeatedly called with different parameters.

If you are worried about threading issues, you can always create a new template for each log ...

0
source

All Articles