Oct 4th, 2011, 03:10 PM
Does Spring TransactionTemplate create threads?
I've got a problem with a corrupted data structure due to concurrent access. I'm trying to rule out possible causes, but I'm not sure how the Spring TransactionTemplate works.
There are multiple threads passing independent lists to the constructor of a CallbackHandler. This CallbackHandler is then passed to the execute method of the TransactionTemplate. There are no synchronized blocks anywhere.
The list is accessed in the CallbackHandler and from the calling Thread before and after the execute method has finished. As far as I understand calling execute DOESN'T start a new Thread. Therefor this should be safe.
Every thread creates its own independent list and CallbackHandler, only the TransactionTemplate is the same for all.
Or does Spring create some new thread at some point?
Tags for this Thread