-
Notifications
You must be signed in to change notification settings - Fork 1.6k
SQLServer: no exception thrown when statement fails #718
Copy link
Copy link
Closed
Milestone
Description
We faced with such problem. When one of patch commands fails to execute properly(not first command), flyway does not throw any exceptions, and marks this patch as executed in schema_version table.
It can be reproduced in such way: just create patch with statements(should fail on ) to flyway-samle project and run it.
INSERT INTO test_user (name1) VALUES ('test');
INSERT INTO test_user (name1) VALUES ('test');
Patch should fail but it doesn't.
We investigated this problem and found reason of bug. On executing statement, JdbcTemplate uses execute method. But it would be better to use http://docs.oracle.com/javase/7/docs/api/java/sql/Statement.html#executeBatch%28%29
Reactions are currently unavailable