I'm using the update method in NamedParamameterJdbcTempalte which implements this org.springframework.jdbc.core.namedparam.NamedParameterJdbcOperations.
I looked up the docs and the only thing I can find is "this method issues an update via a prepared statement, binding the given arguments."
I have code that looks like this
//Calling jdbcTemplate.update() here on Foo objects
//Calling another update on the same set of Foo objects (I know it's dump but let's just leave it as is)
Now my question is will the first update wait until the transaction is completed then return, or it will just issue that request and return? When I get to the second line, do I have any guarantee that the transaction issued by the first call to update has completely finished?
I seem to be seeing mysql deadlock once in a while and I suspect that's because the first update has not finished its job when the second one comes in.
Found this question, but the answer doesn't really answer my question. How to avoid mysql 'Deadlock found when trying to get lock; try restarting transaction'