does NamedParameterJdbcTemplate.update wait until mysql transaction finishes?
Ok, I've probably dug up the entire Google land and still couldn't find anything that could possibly answer my question. :frusty:
I have my little foo method that does some deleting like this:
sqlString and sqlString2 are just delete statements like "Delete * from FooBar". So when I get to the second call to update, do I have any guarantee that whatever operation the first one invokes in the database has already finished? :(think):
private void foo()
jdbcNamedParameterTemplate.update(sqlString, params); //1
jdbcNamedParameterTemplate.update(sqlString2, params2); //2
Re: does NamedParameterJdbcTemplate.update wait until mysql transaction finishes?
Well since you posted this in the Hibernate forum and not in the Spring forum, I'd guess you have been looking in all the wrong places.
Simple logic. Go to the API documentation:
The API documentation says nothing about performing the operation threaded, so it is going to end when the database operation ends. What you do NOT have a guarantee of is that the update will already be either committed or at least flushed to the database, then you'd have to read the Spring documentation on how the database transaction management works. Judging from the API documentation this class is a simple wrapper around JDBC, so whatever is true for JDBC and the database driver you're using is also true for this class.